Class: Volksbanker::Balance

Inherits:
Line
  • Object
show all
Defined in:
lib/volksbanker/balance.rb

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(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

#amountObject (readonly)

Returns the value of attribute amount.



6
7
8
# File 'lib/volksbanker/balance.rb', line 6

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency.



6
7
8
# File 'lib/volksbanker/balance.rb', line 6

def currency
  @currency
end

#dateObject (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_sObject



14
15
16
# File 'lib/volksbanker/balance.rb', line 14

def to_s
  "#{date}: #{'%.2f' % amount} #{currency}"
end