class MT940::AccountBalance
60
Constants
- CONTENT
Attributes
Public Instance Methods
Source
# File lib/mt940.rb, line 151 def parse_content(content) content.match(CONTENT) @balance_type = case @modifier when 'F' :start when 'M' :intermediate end @sign = case ::Regexp.last_match(1) when 'C' :credit when 'D' :debit end raw_date = ::Regexp.last_match(2) @currency = ::Regexp.last_match(3) @amount = parse_amount_in_cents(::Regexp.last_match(4)) @date = case raw_date when 'ALT', '0' nil when DATE ::Date.new("20#{::Regexp.last_match(1)}".to_i, ::Regexp.last_match(2).to_i, ::Regexp.last_match(3).to_i) end end