Class: Volksbanker::Transaction

Inherits:
Line
  • Object
show all
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

Line::DATE_FORMAT

Instance Attribute Summary collapse

Instance Method Summary collapse

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,
              , 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     = 
  @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_numberObject (readonly)

Returns the value of attribute account_number.



21
22
23
# File 'lib/volksbanker/transaction.rb', line 21

def 
  @account_number
end

#amountObject (readonly)

Returns the value of attribute amount.



21
22
23
# File 'lib/volksbanker/transaction.rb', line 21

def amount
  @amount
end

#bicObject (readonly)

Returns the value of attribute bic.



21
22
23
# File 'lib/volksbanker/transaction.rb', line 21

def bic
  @bic
end

#currencyObject (readonly)

Returns the value of attribute currency.



21
22
23
# File 'lib/volksbanker/transaction.rb', line 21

def currency
  @currency
end

#descriptionObject (readonly)

Returns the value of attribute description.



21
22
23
# File 'lib/volksbanker/transaction.rb', line 21

def description
  @description
end

#ibanObject (readonly)

Returns the value of attribute iban.



21
22
23
# File 'lib/volksbanker/transaction.rb', line 21

def iban
  @iban
end

#payer_or_payeeObject (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_dateObject (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_payerObject (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

#referenceObject (readonly)

Returns the value of attribute reference.



21
22
23
# File 'lib/volksbanker/transaction.rb', line 21

def reference
  @reference
end

#sort_codeObject (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_dateObject (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_counterpartyObject



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