Class: FixedLayoutMapper::Mapper::ColumnMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/fixed-layout-mapper.rb

Direct Known Subclasses

ArrayMapper, SimpleMapper, SubLayoutMapper

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#converterObject

Returns the value of attribute converter.



9
10
11
# File 'lib/fixed-layout-mapper.rb', line 9

def converter
  @converter
end

#layout_mapperObject

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