Methods
Public Class
Public Instance
Attributes
actor | [R] | |
body | [R] | |
display_text_range | [R] | |
favorites_count | [R] | |
generator | [R] | |
gnip | [R] | |
id | [R] | |
link | [R] | |
long_object | [R] | |
object | [R] | |
object_type | [R] | |
posted_time | [R] | |
provider | [R] | |
raw | [R] | |
retweet_count | [R] | |
twitter_entities | [R] | |
twitter_filter_level | [R] | |
twitter_lang | [R] | |
verb | [R] |
Public Class methods
new
(params = {})
[show source]
# File lib/gnip_api/gnip/activity.rb, line 7 def initialize params = {} @raw = params @id = params['id'] @object_type = params['objectType'] @actor = Gnip::Actor.new params['actor'] @verb = params['verb'] @posted_time = params['postedTime'] @generator = params['generator'] @provider = params['provider'] @link = params['link'] @body = params['body'] @object = retweet? ? Gnip::Activity.new(params['object']) : params['object'] @favorites_count = params['favoritesCount'] @twitter_entities = params['twitter_entities'] @twitter_filter_level = params['twitter_filter_level'] @twitter_lang = params['twitter_lang'] @retweet_count = params['retweetCount'] @long_object = params['long_object'] @display_text_range = params['display_text_range'] @gnip = Gnip::GnipData.new(params['gnip']) if params['gnip'] end
Public Instance methods
author
()
[show source]
# File lib/gnip_api/gnip/activity.rb, line 68 def author actor.display_name end
retweet?
()
[show source]
# File lib/gnip_api/gnip/activity.rb, line 72 def retweet? verb == 'share' end
to_h
()
[show source]
# File lib/gnip_api/gnip/activity.rb, line 29 def to_h { :id => @id, :objectType => @object_type, :actor => @actor.to_h, :verb => @verb, :postedTime => @posted_time, :generator => @generator, :provider => @provider, :link => @link, :body => @body, :object => @object.kind_of?(Gnip::Activity) ? @object.to_h : @object, :favoritesCount => @favorites_count, :twitter_entities => @twitter_entities, :twitter_filter_level => @twitter_filter_level, :twitter_lang => @twitter_lang, :retweetCount => @retweet_count, :longObject => @long_object, :display_text_range => @display_text_range, :gnip => @gnip ? @gnip.to_h : nil } end
tweet_id
()
[show source]
# File lib/gnip_api/gnip/activity.rb, line 60 def tweet_id @id.split(':').last end