Module: TwitterFriendly::REST::Lists
- Included in:
- API
- Defined in:
- lib/twitter_friendly/rest/lists.rb
Constant Summary collapse
- MAX_LISTS_PER_REQUEST =
1000
- MAX_MEMBERS_PER_REQUEST =
5000
Instance Method Summary collapse
- #list(*args) ⇒ Object
-
#list_members(*args) ⇒ Hash
The members of the specified list.
-
#memberships(*args) ⇒ Hash
The lists the specified user has been added to.
Instance Method Details
#list(*args) ⇒ Object
5 6 7 |
# File 'lib/twitter_friendly/rest/lists.rb', line 5 def list(*args) @twitter.list(*args)&.to_hash end |
#list_members(options = {}) ⇒ Hash #list_members(user, options = {}) ⇒ Hash
Returns The members of the specified list.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/twitter_friendly/rest/lists.rb', line 40 def list_members(*args) = {count: MAX_MEMBERS_PER_REQUEST, skip_status: 1}.merge(args.) args << if .has_key?(:cursor) @twitter.list_members(*args)&.attrs else fetch_resources_with_cursor(__method__, *args) end end |
#list_members(options = {}) ⇒ Hash #list_members(user, options = {}) ⇒ Hash
Returns The lists the specified user has been added to.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/twitter_friendly/rest/lists.rb', line 19 def memberships(*args) = {count: MAX_LISTS_PER_REQUEST}.merge(args.) args << if .has_key?(:cursor) @twitter.memberships(*args)&.attrs else fetch_resources_with_cursor(__method__, *args) end end |