Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/nanotwitter/user.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#timeline ⇒ Object
Returns the value of attribute timeline.
-
#tweets ⇒ Object
Returns the value of attribute tweets.
Instance Method Summary collapse
-
#initialize(response) ⇒ User
constructor
A new instance of User.
- #make_tweets(tweets) ⇒ Object
Constructor Details
#initialize(response) ⇒ User
Returns a new instance of User.
5 6 7 8 9 10 |
# File 'lib/nanotwitter/user.rb', line 5 def initialize(response) @name = response['name'] @id = response['id'] @tweets = make_tweets(response['tweets']) @timeline = make_tweets(response['timeline']) end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
16 17 18 |
# File 'lib/nanotwitter/user.rb', line 16 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/nanotwitter/user.rb', line 16 def name @name end |
#timeline ⇒ Object
Returns the value of attribute timeline.
16 17 18 |
# File 'lib/nanotwitter/user.rb', line 16 def timeline @timeline end |
#tweets ⇒ Object
Returns the value of attribute tweets.
16 17 18 |
# File 'lib/nanotwitter/user.rb', line 16 def tweets @tweets end |