Class: Yt::Collections::ViewerPercentages

Inherits:
Base
  • Object
show all
Defined in:
lib/yt/collections/viewer_percentages.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, of, #where

Methods included from Actions::List

#first!

Constructor Details

This class inherits a constructor from Yt::Collections::Base

Instance Method Details

#allObject



7
8
9
10
11
# File 'lib/yt/collections/viewer_percentages.rb', line 7

def all
  Hash.new{|h,k| h[k] = Hash.new(0.0)}.tap do |hash|
    each{|item| hash[item.gender][item.age_range] = item.value}
  end
end