Class: LogfileInterval::Aggregator::FirstValue
- Defined in:
- lib/logfile_interval/aggregator/first_value.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #add(value, group_by = nil) ⇒ Object
-
#initialize(options = {}) ⇒ FirstValue
constructor
A new instance of FirstValue.
Methods inherited from Base
Methods included from Registrar
#aggregator_classes, #all, #exist?, #inherited, #klass, #register_aggregator
Constructor Details
#initialize(options = {}) ⇒ FirstValue
Returns a new instance of FirstValue.
4 5 6 7 |
# File 'lib/logfile_interval/aggregator/first_value.rb', line 4 def initialize( = {}) super() @val = {} end |
Instance Method Details
#add(value, group_by = nil) ⇒ Object
9 10 11 12 |
# File 'lib/logfile_interval/aggregator/first_value.rb', line 9 def add(value, group_by = nil) @val[key(group_by)] = value @size.increment(key(group_by)) end |