Class: Twterm::User
- Inherits:
-
Object
- Object
- Twterm::User
- Defined in:
- lib/twterm/user.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#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.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#profile_background_image ⇒ Object
readonly
Returns the value of attribute profile_background_image.
-
#profile_image ⇒ Object
readonly
Returns the value of attribute profile_image.
-
#protected ⇒ Object
(also: #protected?)
readonly
Returns the value of attribute protected.
-
#screen_name ⇒ Object
readonly
Returns the value of attribute screen_name.
-
#statuses_count ⇒ Object
readonly
Returns the value of attribute statuses_count.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#verified ⇒ Object
(also: #verified?)
readonly
Returns the value of attribute verified.
-
#website ⇒ Object
readonly
Returns the value of attribute website.
Instance Method Summary collapse
-
#initialize(user) ⇒ User
constructor
A new instance of User.
- #update!(user) ⇒ Object
Constructor Details
#initialize(user) ⇒ User
Returns a new instance of User.
9 10 11 12 |
# File 'lib/twterm/user.rb', line 9 def initialize(user) @id = user.id update!(user) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def description @description end |
#favorites_count ⇒ Object (readonly)
Returns the value of attribute favorites_count.
3 4 5 |
# File 'lib/twterm/user.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/twterm/user.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/twterm/user.rb', line 3 def friends_count @friends_count end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def id @id end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def name @name end |
#profile_background_image ⇒ Object (readonly)
Returns the value of attribute profile_background_image.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def profile_background_image @profile_background_image end |
#profile_image ⇒ Object (readonly)
Returns the value of attribute profile_image.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def profile_image @profile_image end |
#protected ⇒ Object (readonly) Also known as: protected?
Returns the value of attribute protected.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def protected @protected end |
#screen_name ⇒ Object (readonly)
Returns the value of attribute screen_name.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def screen_name @screen_name end |
#statuses_count ⇒ Object (readonly)
Returns the value of attribute statuses_count.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def statuses_count @statuses_count end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def url @url end |
#verified ⇒ Object (readonly) Also known as: verified?
Returns the value of attribute verified.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def verified @verified end |
#website ⇒ Object (readonly)
Returns the value of attribute website.
3 4 5 |
# File 'lib/twterm/user.rb', line 3 def website @website end |
Instance Method Details
#update!(user) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/twterm/user.rb', line 14 def update!(user) @name = user.name @screen_name = user.screen_name @description = user.description.is_a?(Twitter::NullObject) ? '' : user.description @location = user.location.is_a?(Twitter::NullObject) ? '' : user.location @website = user.website @protected = user.protected? @statuses_count = user.statuses_count @favorites_count = user.favorites_count @friends_count = user.friends_count @followers_count = user.followers_count @url = user.url @verified = user.verified? @profile_image = user.profile_image_uri_https @profile_background_image = user. self end |