Class: LogfileInterval::Aggregator::GroupAndCount
- Inherits:
-
Base
- Object
- Base
- LogfileInterval::Aggregator::GroupAndCount
show all
- Defined in:
- lib/logfile_interval/aggregator/group_and_count.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #value, #values
Instance Method Details
#add(value, group_by) ⇒ Object
8
9
10
11
|
# File 'lib/logfile_interval/aggregator/group_and_count.rb', line 8
def add(value, group_by)
raise ArgumentError, 'group_by argument is mandatory for GroupAndCount#add' unless group_by
@val.increment_subkey(value, key(group_by))
end
|
#each ⇒ Object
4
5
6
|
# File 'lib/logfile_interval/aggregator/group_and_count.rb', line 4
def each
@val.each { |k, v| yield k, v }
end
|