class CamtParser::AccountBalance
Public Class Methods
new(amount, currency, date, credit = false)
click to toggle source
# File lib/camt_parser/general/account_balance.rb, line 4 def initialize(amount, currency, date, credit = false) @amount = amount @currency = currency @date = date @credit = credit end
Public Instance Methods
amount()
click to toggle source
# File lib/camt_parser/general/account_balance.rb, line 27 def amount CamtParser::Misc.to_amount(@amount) end
amount_in_cents()
click to toggle source
# File lib/camt_parser/general/account_balance.rb, line 31 def amount_in_cents CamtParser::Misc.to_amount_in_cents(@amount) end
credit?()
click to toggle source
# File lib/camt_parser/general/account_balance.rb, line 23 def credit? @credit end
currency()
click to toggle source
# File lib/camt_parser/general/account_balance.rb, line 11 def currency @currency end
date()
click to toggle source
# File lib/camt_parser/general/account_balance.rb, line 15 def date Date.parse @date end
sign()
click to toggle source
# File lib/camt_parser/general/account_balance.rb, line 19 def sign credit? ? 1 : -1 end
to_h()
click to toggle source
# File lib/camt_parser/general/account_balance.rb, line 35 def to_h { 'amount' => amount, 'amount_in_cents' => amount_in_cents, 'sign' => sign } end