def csv
      @csv ||= CSV.generate do |csv|
        reports.each(&:report).each do |report|
          # If there are no dimensions, but totals, we need to put an extra
          # column at the start for the word "Total".
          # I don't see how totals will be different than the metrics if you
          # don't specify dimensions, but whatever.
          totals_column = report.totals? && !report.dimensions? ? [nil] : []
          csv << totals_column + report.headers
          report.rows.each { |row| csv << totals_column + row.to_a }
          next unless report.totals? # Rubocop did this. Not sure I like it.
          csv << ["Totals"] + if !report.dimensions?
                                report.totals
                              else
                                report.totals[1..-1]
                              end
        end
      end
    end
def csv
      @csv ||= CSV.generate do |csv|
        reports.each(&:report).each do |report|
          # If there are no dimensions, but totals, we need to put an extra
          # column at the start for the word "Total".
          # I don't see how totals will be different than the metrics if you
          # don't specify dimensions, but whatever.
          totals_column = report.totals? && !report.dimensions? ? [nil] : []
          csv << totals_column + report.headers
          report.rows.each { |row| csv << totals_column + row.to_a }
          next unless report.totals? # Rubocop did this. Not sure I like it.
          csv << ["Totals"] + if !report.dimensions?
                                report.totals
                              else
                                report.totals[1..-1]
                              end
        end
      end
    end
Convert a response from Google Analytics into a comma-separated values
 format file.
 @return [String] The result of the query formatted as a comma-separated
   values string.