Class: FixedLayoutMapper::Mapper::ColumnMapper
- Inherits:
-
Object
- Object
- FixedLayoutMapper::Mapper::ColumnMapper
- Defined in:
- lib/fixed-layout-mapper.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#converter ⇒ Object
Returns the value of attribute converter.
-
#layout_mapper ⇒ Object
Returns the value of attribute layout_mapper.
Instance Method Summary collapse
- #convert(value) ⇒ Object
-
#initialize(layout_mapper, converter = nil) ⇒ ColumnMapper
constructor
A new instance of ColumnMapper.
Constructor Details
#initialize(layout_mapper, converter = nil) ⇒ ColumnMapper
Returns a new instance of ColumnMapper.
10 11 12 13 |
# File 'lib/fixed-layout-mapper.rb', line 10 def initialize(layout_mapper, converter = nil) @layout_mapper = layout_mapper @converter = converter end |
Instance Attribute Details
#converter ⇒ Object
Returns the value of attribute converter.
9 10 11 |
# File 'lib/fixed-layout-mapper.rb', line 9 def converter @converter end |
#layout_mapper ⇒ Object
Returns the value of attribute layout_mapper.
9 10 11 |
# File 'lib/fixed-layout-mapper.rb', line 9 def layout_mapper @layout_mapper end |
Instance Method Details
#convert(value) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/fixed-layout-mapper.rb', line 15 def convert(value) if @converter @converter.(value) else value end end |