class MT940::StatementLineInformation
86
Attributes
Public Instance Methods
Source
# File lib/mt940.rb, line 238 def parse_content(content) content.match(/^(\d{3})((.).*)$/) @code = ::Regexp.last_match(1).to_i details = [] account_holder = [] if seperator = ::Regexp.last_match(3) sub_fields = ::Regexp.last_match(2).scan( /#{Regexp.escape(seperator)}(\d{2})([^#{Regexp.escape(seperator)}]*)/ ) sub_fields.each do |(code, content)| case code.to_i when 0 @transaction_description = content when 10 @prima_nota = content when 20..29, 60..63 details << content when 30 @bank_code = content when 31 @account_number = content when 32..33 account_holder << content when 34 @text_key_extension = content else @not_implemented_fields ||= [] @not_implemented_fields << [code, content] warn "code not implemented: code:#{code} content: #{content.inspect}" if $DEBUG end end end @details = details.join("\n") @account_holder = account_holder.join("\n") end