Class: Aloe::Entry
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Aloe::Entry
- Defined in:
- lib/aloe/entry.rb
Instance Method Summary collapse
-
#amount ⇒ Money
Return the amount of entry.
-
#deposit? ⇒ true, false
Is the entry deposit of funds?.
-
#transaction ⇒ Aloe::Transaction
Return the related transaction.
-
#withdrawal? ⇒ true, false
Is the entry withdrawal of funds?.
Instance Method Details
#amount ⇒ Money
Return the amount of entry
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?
47 48 49 |
# File 'lib/aloe/entry.rb', line 47 def deposit? !withdrawal? end |
#transaction ⇒ Aloe::Transaction
Return the related transaction.
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?
54 55 56 |
# File 'lib/aloe/entry.rb', line 54 def withdrawal? amount.negative? end |