Class: Array
Instance Method Summary collapse
Instance Method Details
#to_comma(style = :default) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/comma.rb', line 12 def to_comma(style = :default) = {} if style.is_a? Hash = style style = .delete(:style)||:default end FasterCSV.generate() do |csv| return "" if empty? csv << first.to_comma_headers(style) # REVISIT: request to optionally include headers each do |object| csv << object.to_comma(style) end end end |