Class: Sharedcount::Data
- Inherits:
-
Object
- Object
- Sharedcount::Data
- Defined in:
- lib/sharedcount/data.rb
Instance Attribute Summary collapse
-
#delicious_shares ⇒ Object
Returns the value of attribute delicious_shares.
-
#digg_shares ⇒ Object
Returns the value of attribute digg_shares.
-
#facebook_clicks ⇒ Object
Returns the value of attribute facebook_clicks.
-
#facebook_comments ⇒ Object
Returns the value of attribute facebook_comments.
-
#facebook_commentsbox ⇒ Object
Returns the value of attribute facebook_commentsbox.
-
#facebook_likes ⇒ Object
Returns the value of attribute facebook_likes.
-
#facebook_shares ⇒ Object
Returns the value of attribute facebook_shares.
-
#facebook_total ⇒ Object
Returns the value of attribute facebook_total.
-
#google_buzzs ⇒ Object
Returns the value of attribute google_buzzs.
-
#google_plus_one ⇒ Object
Returns the value of attribute google_plus_one.
-
#json_data ⇒ Object
Returns the value of attribute json_data.
-
#linkedin_shares ⇒ Object
Returns the value of attribute linkedin_shares.
-
#pinterest_shares ⇒ Object
Returns the value of attribute pinterest_shares.
-
#raw_data ⇒ Object
Returns the value of attribute raw_data.
-
#reddit_shares ⇒ Object
Returns the value of attribute reddit_shares.
-
#stumble_upon_shares ⇒ Object
Returns the value of attribute stumble_upon_shares.
-
#total_actions ⇒ Object
Returns the value of attribute total_actions.
-
#twitter_shares ⇒ Object
Returns the value of attribute twitter_shares.
Instance Method Summary collapse
-
#initialize(json_data) ⇒ Data
constructor
A new instance of Data.
Constructor Details
#initialize(json_data) ⇒ Data
Returns a new instance of Data.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sharedcount/data.rb', line 10 def initialize(json_data) self.json_data = json_data self.raw_data = JSON.parse(json_data) self.stumble_upon_shares = (self.raw_data["StumbleUpon"] || nil) self.reddit_shares = (self.raw_data["Reddit"] || nil) self.delicious_shares = (self.raw_data["Delicious"] || nil) self.google_plus_one = (self.raw_data["GooglePlusOne"] || nil) self.google_buzzs = (self.raw_data["Buzz"] || nil) self.twitter_shares = (self.raw_data["Twitter"] || nil) self.digg_shares = (self.raw_data["Diggs"] || nil) self.pinterest_shares = (self.raw_data["Pinterest"] || nil) self.linkedin_shares = (self.raw_data["LinkedIn"] || nil) self.facebook_commentsbox = (self.raw_data["Facebook"]["commentsbox_count"] || nil) self.facebook_clicks = (self.raw_data["Facebook"]["click_count"] || nil) self.facebook_total = (self.raw_data["Facebook"]["total_count"] || nil) self.facebook_comments = (self.raw_data["Facebook"]["comment_count"] || nil) self.facebook_likes = (self.raw_data["Facebook"]["like_count"] || nil) self.facebook_shares = (self.raw_data["Facebook"]["share_count"] || nil) self.total_actions = self.stumble_upon_shares + self.reddit_shares + self.delicious_shares + self.google_plus_one + self.google_buzzs + self.twitter_shares + self.digg_shares + self.pinterest_shares + self.linkedin_shares + self.facebook_total end |
Instance Attribute Details
#delicious_shares ⇒ Object
Returns the value of attribute delicious_shares.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def delicious_shares @delicious_shares end |
#digg_shares ⇒ Object
Returns the value of attribute digg_shares.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def digg_shares @digg_shares end |
#facebook_clicks ⇒ Object
Returns the value of attribute facebook_clicks.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def facebook_clicks @facebook_clicks end |
#facebook_comments ⇒ Object
Returns the value of attribute facebook_comments.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def facebook_comments @facebook_comments end |
#facebook_commentsbox ⇒ Object
Returns the value of attribute facebook_commentsbox.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def facebook_commentsbox @facebook_commentsbox end |
#facebook_likes ⇒ Object
Returns the value of attribute facebook_likes.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def facebook_likes @facebook_likes end |
#facebook_shares ⇒ Object
Returns the value of attribute facebook_shares.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def facebook_shares @facebook_shares end |
#facebook_total ⇒ Object
Returns the value of attribute facebook_total.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def facebook_total @facebook_total end |
#google_buzzs ⇒ Object
Returns the value of attribute google_buzzs.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def google_buzzs @google_buzzs end |
#google_plus_one ⇒ Object
Returns the value of attribute google_plus_one.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def google_plus_one @google_plus_one end |
#json_data ⇒ Object
Returns the value of attribute json_data.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def json_data @json_data end |
#linkedin_shares ⇒ Object
Returns the value of attribute linkedin_shares.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def linkedin_shares @linkedin_shares end |
#pinterest_shares ⇒ Object
Returns the value of attribute pinterest_shares.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def pinterest_shares @pinterest_shares end |
#raw_data ⇒ Object
Returns the value of attribute raw_data.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def raw_data @raw_data end |
#reddit_shares ⇒ Object
Returns the value of attribute reddit_shares.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def reddit_shares @reddit_shares end |
#stumble_upon_shares ⇒ Object
Returns the value of attribute stumble_upon_shares.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def stumble_upon_shares @stumble_upon_shares end |
#total_actions ⇒ Object
Returns the value of attribute total_actions.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def total_actions @total_actions end |
#twitter_shares ⇒ Object
Returns the value of attribute twitter_shares.
4 5 6 |
# File 'lib/sharedcount/data.rb', line 4 def twitter_shares @twitter_shares end |