class ReindeerETL::Destinations::CSVDest
Public Class Methods
new(output_file, delimiter=',')
click to toggle source
# File lib/reindeer-etl/destinations/csv_dest.rb, line 5 def initialize(output_file, delimiter=',') @csv = CSV.open(output_file, 'w', {col_sep: delimiter}) end
Public Instance Methods
close()
click to toggle source
# File lib/reindeer-etl/destinations/csv_dest.rb, line 17 def close @csv.close end
write(row)
click to toggle source
# File lib/reindeer-etl/destinations/csv_dest.rb, line 9 def write(row) unless @headers_written @headers_written = true @csv << row.keys end @csv << row.values end