Class: Keepr::Journal

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/keepr/journal.rb

Instance Method Summary collapse

Instance Method Details

#amountObject



26
27
28
# File 'lib/keepr/journal.rb', line 26

def amount
  debit_postings.sum(&:amount)
end

#credit_postingsObject



18
19
20
# File 'lib/keepr/journal.rb', line 18

def credit_postings
  existing_postings.select(&:credit?)
end

#debit_postingsObject



22
23
24
# File 'lib/keepr/journal.rb', line 22

def debit_postings
  existing_postings.select(&:debit?)
end