Class: Twttr::Model::User
- Inherits:
-
Object
- Object
- Twttr::Model::User
- Extended by:
- Forwardable
- Defined in:
- lib/twttr/model/user.rb
Overview
Twitter User representation developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/user
Instance Method Summary collapse
- #following(pagination_token: nil, &block) ⇒ Object
-
#initialize(data, client = nil) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(data, client = nil) ⇒ User
Returns a new instance of User.
13 14 15 16 |
# File 'lib/twttr/model/user.rb', line 13 def initialize(data, client = nil) @data = JSON.parse(data.to_json, object_class: OpenStruct) @client = client end |
Instance Method Details
#following(pagination_token: nil, &block) ⇒ Object
18 19 20 |
# File 'lib/twttr/model/user.rb', line 18 def following(pagination_token: nil, &block) client.following(id, pagination_token: pagination_token, &block) end |