Class: CSVPlusPlus::Writer::CSV
- Inherits:
-
BaseWriter
- Object
- BaseWriter
- CSVPlusPlus::Writer::CSV
- Includes:
- FileBackerUpper
- Defined in:
- lib/csv_plus_plus/writer/csv.rb
Overview
A class that can output a Template to CSV
Instance Attribute Summary
Attributes inherited from BaseWriter
Instance Method Summary collapse
-
#write(template) ⇒ Object
write a
templateto CSV.
Methods included from FileBackerUpper
Instance Method Details
#write(template) ⇒ Object
write a template to CSV
12 13 14 15 16 17 18 19 |
# File 'lib/csv_plus_plus/writer/csv.rb', line 12 def write(template) # TODO: also read it and merge the results ::CSV.open(@options.output_filename, 'wb') do |csv| template.rows.each do |row| csv << build_row(row) end end end |