Class: AsciiDataTools::Formatting::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/ascii-data-tools/formatting.rb

Instance Method Summary collapse

Constructor Details

#initializeFormatter

Returns a new instance of Formatter.



4
5
6
# File 'lib/ascii-data-tools/formatting.rb', line 4

def initialize
  @record_counter = 0
end

Instance Method Details

#format(record) ⇒ Object Also known as: transform



8
9
10
# File 'lib/ascii-data-tools/formatting.rb', line 8

def format(record)
  formattable(record.type).format(next_record_counter_and_increment, record.values)
end