Class: FixedLayoutMapper::Mapper::SubLayoutMapper
Instance Attribute Summary
Attributes inherited from ColumnMapper
#converter, #layout_mapper
Instance Method Summary
collapse
#convert
Constructor Details
#initialize(layout_mapper, layout_id, converter = nil) ⇒ SubLayoutMapper
Returns a new instance of SubLayoutMapper.
42
43
44
45
|
# File 'lib/fixed-layout-mapper.rb', line 42
def initialize(layout_mapper, layout_id, converter = nil)
super layout_mapper, converter
@layout_id = layout_id
end
|
Instance Method Details
#length ⇒ Object
52
53
54
|
# File 'lib/fixed-layout-mapper.rb', line 52
def length
layout_mapper.get_layout(@layout_id).length
end
|
#map(bytes) ⇒ Object
47
48
49
50
|
# File 'lib/fixed-layout-mapper.rb', line 47
def map(bytes)
value, rest = layout_mapper.get_layout(@layout_id).map(bytes, layout_mapper.get_result_class(@layout_id))
[convert(value), rest]
end
|