You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: survey_download_service.rb
    path of file: ./repos/coursemology2/app/services/course/survey
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
require 'csv'

class Course::Survey::SurveyDownloadService
  class << self
    # Downloads the survey to its own folder in the base directory.
    #
    # @return [String] The path to the csv file.
    def download(survey)
      survey_csv = generate_csv(survey)
      base_dir = Dir.mktmpdir('coursemology-survey-')
      dst_path = File.join(base_dir, "#{survey.title}.cs
    
    def generate_row(response, questions)
      answers_hash = response.answers.to_h { |answer| [answer.question_id, answer] }
      values = questions.map do |question|
        answer = answers_hash[question.id]
        generate_value(answer)
      end
      [
        response.submitted_at,
        response.submitted_at ? response.updated_at : response.submitted_at,
        response.course_user.id,
        response.course_user.name,
        response.course_user.role,
        *values
      ]
    end