Sha256: 848db6a90c48a26d119a245b5626565a41d7d4c79630fabd23ecc5eb9a684828
Contents?: true
Size: 1.21 KB
Versions: 3
Compression:
Stored size: 1.21 KB
Contents
class MT940::Rabobank < MT940::Base private def parse_tag_25 @line.gsub!('.','') if @line.match(Regexp.new ":25:(#{MT940::IBAN_PATTERN})") @bank_account = $1 @sepa = true else @bank_account = $1.gsub(/^0/,'') if @line.match(/^:\d{2}:[^\d]*(\d*)/) end end def parse_tag_61 match = super(/^:61:(\d{6})(C|D)(\d+),(\d{0,2})\w{4}\w{1}(\d{9}|NONREF|EREF)(.*)$/) if match if @sepa @transaction.contra_account = match[6].strip else @transaction.contra_account = match[5].strip @transaction.contra_account_owner = match[6].strip end end end def parse_tag_86 if @line.match(/^:86:(.*)$/) @line = $1.strip @sepa ? determine_description_after_sepa : determine_description_before_sepa @transaction.description = @description.strip end end def determine_description_before_sepa if @description.nil? @description = @line else @description += ' ' + @line end end def determine_description_after_sepa hash = hashify_description(@line) @description = '' @description += hash['NAME'] if hash['NAME'] @description += ' ' @description += hash['REMI'] if hash['REMI'] end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mt940-0.8.0 | lib/mt940/banks/rabobank.rb |
mt940-0.7.1 | lib/mt940/banks/rabobank.rb |
mt940-0.7.0 | lib/mt940/banks/rabobank.rb |