Class: FacebookTopics::Insight
- Inherits:
-
Object
- Object
- FacebookTopics::Insight
- Defined in:
- lib/facebook_topics/results/insight.rb
Instance Attribute Summary collapse
-
#breakdown ⇒ Object
Returns the value of attribute breakdown.
-
#volume ⇒ Object
Returns the value of attribute volume.
Instance Method Summary collapse
-
#initialize(results = {}) ⇒ Insight
constructor
A new instance of Insight.
Constructor Details
#initialize(results = {}) ⇒ Insight
Returns a new instance of Insight.
5 6 7 8 9 |
# File 'lib/facebook_topics/results/insight.rb', line 5 def initialize(results = {}) raise RuntimeError.new results["error"]["message"] if results.has_key? "error" @volume = results["data"].first["mentions"]["data"].shift["count"].to_i rescue 0 @breakdown = results["data"].first["mentions"]["data"] rescue [] end |
Instance Attribute Details
#breakdown ⇒ Object
Returns the value of attribute breakdown.
3 4 5 |
# File 'lib/facebook_topics/results/insight.rb', line 3 def breakdown @breakdown end |
#volume ⇒ Object
Returns the value of attribute volume.
3 4 5 |
# File 'lib/facebook_topics/results/insight.rb', line 3 def volume @volume end |