Class: CFONB::LineParser::Base
- Inherits:
-
Object
- Object
- CFONB::LineParser::Base
- Defined in:
- lib/cfonb/line_parser/base.rb
Direct Known Subclasses
Constant Summary collapse
- BASE_DICTIONARY =
[ ['code', (0..1)].freeze, ['bank', (2..6)], ['branch', (11..15)], ['currency', (16..18)], ['scale', 19, proc { _1.to_i }], # rubocop:disable Style/SymbolProc ['account', (21..31)], ['date', (34..39), proc { |value, instance| instance.send(:parse_date, value) }], ].freeze
- AMOUNT_SPECIFIERS =
{ 'A' => { sign: 1, value: '1' }, 'B' => { sign: 1, value: '2' }, 'C' => { sign: 1, value: '3' }, 'D' => { sign: 1, value: '4' }, 'E' => { sign: 1, value: '5' }, 'F' => { sign: 1, value: '6' }, 'G' => { sign: 1, value: '7' }, 'H' => { sign: 1, value: '8' }, 'I' => { sign: 1, value: '9' }, '{' => { sign: 1, value: '0' }, 'J' => { sign: -1, value: '1' }, 'K' => { sign: -1, value: '2' }, 'L' => { sign: -1, value: '3' }, 'M' => { sign: -1, value: '4' }, 'N' => { sign: -1, value: '5' }, 'O' => { sign: -1, value: '6' }, 'P' => { sign: -1, value: '7' }, 'Q' => { sign: -1, value: '8' }, 'R' => { sign: -1, value: '9' }, '}' => { sign: -1, value: '0' }, }.transform_values(&:freeze).freeze
Instance Method Summary collapse
-
#initialize(input) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(input) ⇒ Base
Returns a new instance of Base.
45 46 47 48 |
# File 'lib/cfonb/line_parser/base.rb', line 45 def initialize(input) @body = input (BASE_DICTIONARY + self.class::DICTIONARY).each { parse_attribute(*_1) } end |