Sha256: be55631b9980de4fecec4a73bb10667cd00443ab0b0528e8eb1ff35d06b1c2bf

Contents?: true

Size: 519 Bytes

Versions: 1

Compression:

Stored size: 519 Bytes

Contents

class MT940::Rabobank < MT940::Base

  def parse_tag_61
    if @line.match(/^:61:\d{6}(C|D)(\d+),(\d{0,2})\w{4}(.{16})(.+)$/)
      type = $1 == 'D' ? -1 : 1
      @transaction = MT940::Transaction.new(:bank_account => @bank_account, :amount => type * ($2 + '.' + $3).to_f)
      @transaction.contra_account = $4.strip
      @transaction.contra_account_name = $5.strip
      @transactions << @transaction
    end
  end

  def parse_tag_86
    @transaction.description = $1.strip if @line.match(/^:86:(.*)$/)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mt940-0.2.0 lib/mt940/banks/rabobank.rb