Class: Keepr::Journal

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

Instance Method Summary collapse

Instance Method Details

#amountObject



28
29
30
# File 'lib/keepr/journal.rb', line 28

def amount
  debit_postings.sum(&:amount)
end

#credit_postingsObject



20
21
22
# File 'lib/keepr/journal.rb', line 20

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

#debit_postingsObject



24
25
26
# File 'lib/keepr/journal.rb', line 24

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