Class: Gnip::Actor
Constant Summary
Constants inherited from Message
Instance Attribute Summary collapse
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#favorites_count ⇒ Object
readonly
Returns the value of attribute favorites_count.
-
#followers_count ⇒ Object
readonly
Returns the value of attribute followers_count.
-
#friends_count ⇒ Object
readonly
Returns the value of attribute friends_count.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#languages ⇒ Object
readonly
Returns the value of attribute languages.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#object_type ⇒ Object
readonly
Returns the value of attribute object_type.
-
#posted_time ⇒ Object
readonly
Returns the value of attribute posted_time.
-
#preferred_username ⇒ Object
readonly
Returns the value of attribute preferred_username.
-
#statuses_count ⇒ Object
readonly
Returns the value of attribute statuses_count.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#twitter_time_zone ⇒ Object
readonly
Returns the value of attribute twitter_time_zone.
-
#utc_offset ⇒ Object
readonly
Returns the value of attribute utc_offset.
-
#verified ⇒ Object
readonly
Returns the value of attribute verified.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Actor
constructor
A new instance of Actor.
- #original_attributes ⇒ Object
- #to_json ⇒ Object
- #user_id ⇒ Object
Methods inherited from Message
#activity?, build, #error?, #generate_json, #info?, #system_message?, #warn?
Constructor Details
#initialize(params = {}) ⇒ Actor
Returns a new instance of Actor.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/gnip_api/gnip/actor.rb', line 7 def initialize params = {} @object_type = params['objectType'] @id = params['id'] @link = params['link'] @display_name = params['displayName'] @posted_time = params['postedTime'] @image = params['image'] @summary = params['summary'] @links = params['links'] @friends_count = params['friendsCount'] @followers_count = params['followersCount'] @listed_count = params['listedCount'] @statuses_count = params['statusesCount'] @twitter_time_zone = params['twitterTimeZone'] @verified = params['verified'] @utc_offset = params['utcOffset'] @preferred_username = params['preferredUsername'] @languages = params['languages'].join(',') @location = params['location'] @favorites_count = params['favoritesCount'] end |
Instance Attribute Details
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def display_name @display_name end |
#favorites_count ⇒ Object (readonly)
Returns the value of attribute favorites_count.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def favorites_count @favorites_count end |
#followers_count ⇒ Object (readonly)
Returns the value of attribute followers_count.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def followers_count @followers_count end |
#friends_count ⇒ Object (readonly)
Returns the value of attribute friends_count.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def friends_count @friends_count end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def id @id end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def image @image end |
#languages ⇒ Object (readonly)
Returns the value of attribute languages.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def languages @languages end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def link @link end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def links @links end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def location @location end |
#object_type ⇒ Object (readonly)
Returns the value of attribute object_type.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def object_type @object_type end |
#posted_time ⇒ Object (readonly)
Returns the value of attribute posted_time.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def posted_time @posted_time end |
#preferred_username ⇒ Object (readonly)
Returns the value of attribute preferred_username.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def preferred_username @preferred_username end |
#statuses_count ⇒ Object (readonly)
Returns the value of attribute statuses_count.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def statuses_count @statuses_count end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def summary @summary end |
#twitter_time_zone ⇒ Object (readonly)
Returns the value of attribute twitter_time_zone.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def twitter_time_zone @twitter_time_zone end |
#utc_offset ⇒ Object (readonly)
Returns the value of attribute utc_offset.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def utc_offset @utc_offset end |
#verified ⇒ Object (readonly)
Returns the value of attribute verified.
3 4 5 |
# File 'lib/gnip_api/gnip/actor.rb', line 3 def verified @verified end |
Instance Method Details
#original_attributes ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/gnip_api/gnip/actor.rb', line 29 def original_attributes { :objectType => @object_type, :id => @id, :link => @link, :displayName => @display_name, :postedTime => @posted_time, :image => @image, :summary => @summary, :links => @links, :friendsCount => @friends_count, :followersCount => @followers_count, :listedCount => @listed_count, :statusesCount => @statuses_count, :twitterTimeZone => @twitter_time_zone, :verified => @verified, :utcOffset => @utc_offset, :preferredUsername => @preferred_username, :languages => @languages.split(','), :location => @location, :favoritesCount => @favorites_count } end |
#to_json ⇒ Object
61 62 63 |
# File 'lib/gnip_api/gnip/actor.rb', line 61 def to_json generate_json(original_attributes) end |
#user_id ⇒ Object
53 54 55 |
# File 'lib/gnip_api/gnip/actor.rb', line 53 def user_id @id.split(':').last end |