Class: Tap::Tasks::Dump::Csv

Inherits:
Tap::Tasks::Dump show all
Defined in:
lib/tap/tasks/dump/csv.rb

Overview

:startdoc::task dumps data as csv

Dumps arrays as CSV data. Each array passed to dump will be formatted into a single line of csv, ie multiple dumps build the csv results. Non-array objects are converted to arrays using to_ary.

% tap load/yaml '["a", "b", "c"]' -: dump/csv
a,b,c

Instance Method Summary collapse

Instance Method Details

#dump(data, io) ⇒ Object



22
23
24
# File 'lib/tap/tasks/dump/csv.rb', line 22

def dump(data, io)
  io << generate_line(data.to_ary)
end