Module: EagleClaw::Formatters::CSV

Includes:
EagleClaw::Formatter
Defined in:
lib/eagleclaw/formatters/csv.rb

Class Method Summary collapse

Class Method Details

.format(data, problems) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/eagleclaw/formatters/csv.rb', line 7

def self.format(data, problems)
  keys = data.first.keys
  FasterCSV.generate do |out|
    out << keys
    data.each do |datum|
      out << keys.map(&datum.method(:[]))
    end
  end
end