Class: FrequencyAnalyser::Aggregation

Inherits:
Hash
  • Object
show all
Defined in:
lib/frequency_analyser/aggregation.rb

Instance Method Summary collapse

Constructor Details

#initializeAggregation

Returns a new instance of Aggregation.



3
4
5
# File 'lib/frequency_analyser/aggregation.rb', line 3

def initialize
  self.default = 0
end

Instance Method Details

#<<(other) ⇒ Object



7
8
9
10
11
# File 'lib/frequency_analyser/aggregation.rb', line 7

def <<(other)
  other.each do |key, value|
    self[key] += value
  end
end