Class: MT940::Statement

Inherits:
Field
  • Object
show all
Defined in:
lib/mt940.rb

Overview

28

Constant Summary collapse

CONTENT =
/^(0|(\d{5,5})\/(\d{2,5}))$/

Constants inherited from Field

Field::DATE, Field::SHORT_DATE

Instance Attribute Summary collapse

Attributes inherited from Field

#content, #modifier

Instance Method Summary collapse

Methods inherited from Field

for, #initialize

Constructor Details

This class inherits a constructor from MT940::Field

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



122
123
124
# File 'lib/mt940.rb', line 122

def number
  @number
end

#sheetObject (readonly)

Returns the value of attribute sheet.



122
123
124
# File 'lib/mt940.rb', line 122

def sheet
  @sheet
end

Instance Method Details

#parse_content(content) ⇒ Object



126
127
128
129
130
131
132
133
# File 'lib/mt940.rb', line 126

def parse_content(content)
  content.match(CONTENT)
  if $1 == '0'
    @number = @sheet = 0
  else
    @number, @sheet = $2.to_i, $3.to_i
  end
end