Class: Volksbanker::Transaction
- Defined in:
- lib/volksbanker/transaction.rb
Overview
A transaction has the following fields on the Volksbank download:
posting date
value date
payer/payee
recipient/payer
account no.
iban
sortcode (BLZ)
sortcode (BIC)
description
reference
currency
amount
credit (H) / debit (S)
Constant Summary
Constants inherited from Line
Instance Attribute Summary collapse
-
#account_number ⇒ Object
readonly
Returns the value of attribute account_number.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#bic ⇒ Object
readonly
Returns the value of attribute bic.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#iban ⇒ Object
readonly
Returns the value of attribute iban.
-
#payer_or_payee ⇒ Object
readonly
Returns the value of attribute payer_or_payee.
-
#posting_date ⇒ Object
readonly
Returns the value of attribute posting_date.
-
#recipient_or_payer ⇒ Object
readonly
Returns the value of attribute recipient_or_payer.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#sort_code ⇒ Object
readonly
Returns the value of attribute sort_code.
-
#value_date ⇒ Object
readonly
Returns the value of attribute value_date.
Instance Method Summary collapse
- #description_with_counterparty ⇒ Object
-
#initialize(posting_date, value_date, payer_or_payee, recipient_or_payer, account_number, iban, sort_code, bic, description, reference, currency, amount, credit_or_debit) ⇒ Transaction
constructor
A new instance of Transaction.
Methods inherited from Line
parse, #parse_amount, #parse_date
Constructor Details
#initialize(posting_date, value_date, payer_or_payee, recipient_or_payer, account_number, iban, sort_code, bic, description, reference, currency, amount, credit_or_debit) ⇒ Transaction
Returns a new instance of Transaction.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/volksbanker/transaction.rb', line 25 def initialize(posting_date, value_date, payer_or_payee, recipient_or_payer, account_number, iban, sort_code, bic, description, reference, currency, amount, credit_or_debit) @posting_date = parse_date posting_date @value_date = parse_date value_date @payer_or_payee = payer_or_payee @recipient_or_payer = recipient_or_payer @account_number = account_number @iban = iban @sort_code = sort_code @bic = bic @description = description @reference = reference @currency = currency @amount = parse_amount amount, credit_or_debit end |
Instance Attribute Details
#account_number ⇒ Object (readonly)
Returns the value of attribute account_number.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def account_number @account_number end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def amount @amount end |
#bic ⇒ Object (readonly)
Returns the value of attribute bic.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def bic @bic end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def currency @currency end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def description @description end |
#iban ⇒ Object (readonly)
Returns the value of attribute iban.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def iban @iban end |
#payer_or_payee ⇒ Object (readonly)
Returns the value of attribute payer_or_payee.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def payer_or_payee @payer_or_payee end |
#posting_date ⇒ Object (readonly)
Returns the value of attribute posting_date.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def posting_date @posting_date end |
#recipient_or_payer ⇒ Object (readonly)
Returns the value of attribute recipient_or_payer.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def recipient_or_payer @recipient_or_payer end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def reference @reference end |
#sort_code ⇒ Object (readonly)
Returns the value of attribute sort_code.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def sort_code @sort_code end |
#value_date ⇒ Object (readonly)
Returns the value of attribute value_date.
21 22 23 |
# File 'lib/volksbanker/transaction.rb', line 21 def value_date @value_date end |
Instance Method Details
#description_with_counterparty ⇒ Object
42 43 44 45 46 |
# File 'lib/volksbanker/transaction.rb', line 42 def description_with_counterparty x = description x += " (#{recipient_or_payer})" unless recipient_or_payer.nil? x end |