Module: Jirafe::Resource::TimeSeries

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
# File 'lib/jirafe/resource/time_series.rb', line 4

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#observation_totalsObject



18
19
20
21
22
23
24
25
# File 'lib/jirafe/resource/time_series.rb', line 18

def observation_totals
  self.class.count_keys.inject({}) do |hash, key|
    hash[key] = observe.inject(0) do |sum, observation|
      sum += observation[key]
    end
    hash
  end
end