Class: ArcFurnace::SuffixedFixedColumnCSVSink
- Inherits:
-
FixedColumnCSVSink
- Object
- Sink
- FixedColumnCSVSink
- ArcFurnace::SuffixedFixedColumnCSVSink
- Defined in:
- lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
Instance Method Summary collapse
Methods inherited from FixedColumnCSVSink
Methods inherited from Sink
Constructor Details
This class inherits a constructor from ArcFurnace::FixedColumnCSVSink
Instance Method Details
#write_header ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/arc-furnace/suffixed_fixed_column_csv_sink.rb', line 7 def write_header csv << fields.each_with_object([]) do |(key, count), result| if count > 1 count.times { |index| result << "#{key} #{index + 1}" } else result << key end end end |