Sha256: 2d6af8fdd39dab9aba19c1585ae3e5fb9d2cd0a703e660e0fc9f40eb024e96f0

Contents?: true

Size: 405 Bytes

Versions: 40

Compression:

Stored size: 405 Bytes

Contents

require 'arc-furnace/fixed_column_csv_sink'

module ArcFurnace
  class SuffixedFixedColumnCSVSink < FixedColumnCSVSink
    private_attr_reader :fields

    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

  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
arc-furnace-0.1.42 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.41 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.40 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.39 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.38 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.37 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.36 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.35 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.34 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.33 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.32 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.31 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.30 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.29 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.28 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.27 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.26 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.25 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.24 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb
arc-furnace-0.1.23 lib/arc-furnace/suffixed_fixed_column_csv_sink.rb