Class: MT940::StatementLine
Overview
61
Constant Summary collapse
- CONTENT =
/^(\d{6})(\d{4})?(C|D|RC|RD)\D?(\d{1,12},\d{0,2})((?:N|F).{3})(NONREF|.{0,16})(?:$|\/\/)(.*)/
Constants inherited from Field
Field::DATE, Field::LINE, Field::SHORT_DATE
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#entry_date ⇒ Object
readonly
Returns the value of attribute entry_date.
-
#funds_code ⇒ Object
readonly
Returns the value of attribute funds_code.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#swift_code ⇒ Object
readonly
Returns the value of attribute swift_code.
-
#transaction_description ⇒ Object
readonly
Returns the value of attribute transaction_description.
Attributes inherited from Field
Instance Method Summary collapse
Methods inherited from Field
Constructor Details
This class inherits a constructor from MT940::Field
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
181 182 183 |
# File 'lib/mt940.rb', line 181 def amount @amount end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
181 182 183 |
# File 'lib/mt940.rb', line 181 def date @date end |
#entry_date ⇒ Object (readonly)
Returns the value of attribute entry_date.
181 182 183 |
# File 'lib/mt940.rb', line 181 def entry_date @entry_date end |
#funds_code ⇒ Object (readonly)
Returns the value of attribute funds_code.
181 182 183 |
# File 'lib/mt940.rb', line 181 def funds_code @funds_code end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
181 182 183 |
# File 'lib/mt940.rb', line 181 def reference @reference end |
#swift_code ⇒ Object (readonly)
Returns the value of attribute swift_code.
181 182 183 |
# File 'lib/mt940.rb', line 181 def swift_code @swift_code end |
#transaction_description ⇒ Object (readonly)
Returns the value of attribute transaction_description.
181 182 183 |
# File 'lib/mt940.rb', line 181 def transaction_description @transaction_description end |
Instance Method Details
#parse_content(content) ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/mt940.rb', line 185 def parse_content(content) content.match(CONTENT) raw_date = $1 raw_entry_date = $2 @funds_code = case $3 when 'C' :credit when 'D' :debit when 'RC' :return_credit when 'RD' :return_debit end @amount = parse_amount_in_cents($4) @swift_code = $5 @reference = $6 @transaction_description = $7 @date = parse_date(raw_date) @entry_date = parse_entry_date(raw_entry_date, @date) if raw_entry_date end |
#value_date ⇒ Object
211 212 213 |
# File 'lib/mt940.rb', line 211 def value_date @date end |