class Cmxl::Fields::AccountBalance
Public Instance Methods
amount()
click to toggle source
# File lib/cmxl/fields/account_balance.rb, line 19 def amount to_amount(data['amount']) end
amount_in_cents()
click to toggle source
# File lib/cmxl/fields/account_balance.rb, line 27 def amount_in_cents to_amount_in_cents(data['amount']) end
credit?()
click to toggle source
# File lib/cmxl/fields/account_balance.rb, line 11 def credit? data['funds_code'].to_s.casecmp('C').zero? end
date()
click to toggle source
# File lib/cmxl/fields/account_balance.rb, line 7 def date to_date(data['date']) end
debit?()
click to toggle source
# File lib/cmxl/fields/account_balance.rb, line 15 def debit? !credit? end
sign()
click to toggle source
# File lib/cmxl/fields/account_balance.rb, line 23 def sign credit? ? 1 : -1 end
to_h()
click to toggle source
Calls superclass method
Cmxl::Field#to_h
# File lib/cmxl/fields/account_balance.rb, line 31 def to_h super.merge( 'date' => date, 'funds_code' => funds_code, 'credit' => credit?, 'debit' => debit?, 'currency' => currency, 'amount' => amount, 'amount_in_cents' => amount_in_cents, 'sign' => sign ) end