Class: Sorenson::ThreeSixty::AssetMetrics
- Defined in:
- lib/sorenson/threesixty/asset_metrics.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#filePlayData ⇒ Object
Returns the value of attribute filePlayData.
-
#playData ⇒ Object
Returns the value of attribute playData.
-
#playTotal ⇒ Object
Returns the value of attribute playTotal.
Class Method Summary collapse
-
.find(account, startDate, endDate) ⇒ Object
Class Methods.
Instance Method Summary collapse
-
#initialize(data) ⇒ AssetMetrics
constructor
Instance Methods.
Methods inherited from Base
debug=, debug?, host, #post_to, post_to, protocol, token_for, use_ssl=, use_ssl?
Constructor Details
#initialize(data) ⇒ AssetMetrics
Instance Methods
14 15 16 17 18 19 20 21 22 |
# File 'lib/sorenson/threesixty/asset_metrics.rb', line 14 def initialize(data) self.playTotal = data['playTotal'] self.filePlayData = data['filePlayData'] self.playData = {} data['playData'].each do |playData| self.playData[playData['eventDay']] = playData['plays'] end end |
Instance Attribute Details
#filePlayData ⇒ Object
Returns the value of attribute filePlayData.
5 6 7 |
# File 'lib/sorenson/threesixty/asset_metrics.rb', line 5 def filePlayData @filePlayData end |
#playData ⇒ Object
Returns the value of attribute playData.
5 6 7 |
# File 'lib/sorenson/threesixty/asset_metrics.rb', line 5 def playData @playData end |
#playTotal ⇒ Object
Returns the value of attribute playTotal.
5 6 7 |
# File 'lib/sorenson/threesixty/asset_metrics.rb', line 5 def playTotal @playTotal end |
Class Method Details
.find(account, startDate, endDate) ⇒ Object
Class Methods
8 9 10 11 |
# File 'lib/sorenson/threesixty/asset_metrics.rb', line 8 def self.find(account, startDate, endDate) data = post_to("/api/getAccountDashboardMetrics?accountId=#{account.id}&startDate=#{startDate}&endDate=#{endDate}") AssetMetrics.new(data) end |