Class: AsciiDataTools::Formatting::Formatter
- Inherits:
-
Object
- Object
- AsciiDataTools::Formatting::Formatter
- Defined in:
- lib/ascii-data-tools/formatting.rb
Instance Method Summary collapse
- #format(record) ⇒ Object (also: #transform)
-
#initialize ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize ⇒ Formatter
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 |