Module: Bean::User::InstanceMethods

Defined in:
lib/bean/user.rb

Instance Method Summary collapse

Instance Method Details

#balance(account = 'asset', currency = 'USD') ⇒ Object



15
16
17
18
19
# File 'lib/bean/user.rb', line 15

def balance(='asset',currency='USD')
  debits = transfers.debiting().in_currency(currency).sum(:amount)
  credits = transfers.crediting().in_currency(currency).sum(:amount)
  Money.new(debits - credits, currency.to_s)
end

#credit_cardObject



21
22
# File 'lib/bean/user.rb', line 21

def credit_card
end