Class: Aloe::Entry

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/aloe/entry.rb

Instance Method Summary collapse

Instance Method Details

#amountMoney

Return the amount of entry

Returns:

  • (Money)

    The amount



33
34
35
# File 'lib/aloe/entry.rb', line 33

def amount
  Money.new read_attribute(:amount), currency
end

#deposit?true, false

Is the entry deposit of funds?

Returns:

  • (true, false)


47
48
49
# File 'lib/aloe/entry.rb', line 47

def deposit?
  !withdrawal?
end

#transactionAloe::Transaction

Return the related transaction.

Returns:



40
41
42
# File 'lib/aloe/entry.rb', line 40

def transaction
  credit_transaction || debit_transaction
end

#withdrawal?true, false

Is the entry withdrawal of funds?

Returns:

  • (true, false)


54
55
56
# File 'lib/aloe/entry.rb', line 54

def withdrawal?
  amount.negative?
end