Class: Volksbanker::Balance
Constant Summary
Constants inherited from Line
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
Instance Method Summary collapse
-
#initialize(date, _, _, _, _, _, _, _, _, _, currency, amount, credit_or_debit) ⇒ Balance
constructor
A new instance of Balance.
- #to_s ⇒ Object
Methods inherited from Line
parse, #parse_amount, #parse_date
Constructor Details
#initialize(date, _, _, _, _, _, _, _, _, _, currency, amount, credit_or_debit) ⇒ Balance
Returns a new instance of Balance.
8 9 10 11 12 |
# File 'lib/volksbanker/balance.rb', line 8 def initialize(date, _, _, _, _, _, _, _, _, _, currency, amount, credit_or_debit) @date = parse_date date @currency = currency @amount = parse_amount amount, credit_or_debit end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
6 7 8 |
# File 'lib/volksbanker/balance.rb', line 6 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
6 7 8 |
# File 'lib/volksbanker/balance.rb', line 6 def currency @currency end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
6 7 8 |
# File 'lib/volksbanker/balance.rb', line 6 def date @date end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/volksbanker/balance.rb', line 14 def to_s "#{date}: #{'%.2f' % amount} #{currency}" end |