Class: DoubleEntry::Reporting::LineAggregate

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/double_entry/reporting/line_aggregate.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.aggregate(function:, account:, partner_account:, code:, range:, named_scopes:) ⇒ Object



5
6
7
8
9
10
# File 'lib/double_entry/reporting/line_aggregate.rb', line 5

def self.aggregate(function:, account:, partner_account:, code:, range:, named_scopes:)
  collection_filter = LineAggregateFilter.new(account: , partner_account: ,
                                              code: code, range: range, filter_criteria: named_scopes)
  collection = collection_filter.filter
  collection.send(function, :amount)
end

Instance Method Details

#keyObject



12
13
14
# File 'lib/double_entry/reporting/line_aggregate.rb', line 12

def key
  "#{year}:#{month}:#{week}:#{day}:#{hour}"
end