Class: MT940Structured::Parsers::Triodos::TransactionParser
- Inherits:
-
Object
- Object
- MT940Structured::Parsers::Triodos::TransactionParser
- Includes:
- DateParser, DefaultLine61Parser
- Defined in:
- lib/mt940_structured/parsers/tridios/transaction_parser.rb
Instance Method Summary collapse
Methods included from DefaultLine61Parser
Methods included from DateParser
Instance Method Details
#enrich_transaction(transaction, line_86) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mt940_structured/parsers/tridios/transaction_parser.rb', line 10 def enrich_transaction(transaction, line_86) if line_86.match(/^:86:\s?(.*)\Z/m) temp_description = $1.gsub(/\n/, ' ').gsub(/>\d{2}/, '').strip if temp_description.match(/^\d+(\d{9})(.*)$/) transaction.contra_account = $1.rjust(9, '000000000') transaction.description = $2.strip else transaction.description = temp_description end end end |
#get_regex_for_line_61 ⇒ Object
6 7 8 |
# File 'lib/mt940_structured/parsers/tridios/transaction_parser.rb', line 6 def get_regex_for_line_61 /^:61:(\d{6})(C|D)(\d+),(\d{0,2})/ end |