Sha256: b7ef735aafc1b23a9266cb882c479948c00191f2b4c66aceac3896689a461c9a

Contents?: true

Size: 659 Bytes

Versions: 3

Compression:

Stored size: 659 Bytes

Contents

class MT940::Abnamro < MT940::Base

  private

  def parse_tag_61
    super(/^:61:(\d{6})\d{4}(C|D)(\d+),(\d{0,2})/)
  end

  def parse_line_before_sepa
    @description = @line.gsub(/>\d{2}/,'').strip
    if @description.match(/^(GIRO)\s+(\d+)(.+)/)
      @contra_account = $2.rjust(9, '000000000')
      @description    = $3
    elsif @description.match(/^(\d{2}.\d{2}.\d{2}.\d{3})(.+)/)
      @description    = $2
      @contra_account = $1.gsub('.','')
    end
  end

  def parse_line_after_sepa
    hash = hashify_description(@line)
    @description    = hash['REMI']
    @contra_account = hash['IBAN']
  end

  def sepa?
    @line[0] == '/'
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mt940-0.8.0 lib/mt940/banks/abnamro.rb
mt940-0.7.1 lib/mt940/banks/abnamro.rb
mt940-0.7.0 lib/mt940/banks/abnamro.rb