Module: Twitter::Client::SuggestedUsers
- Included in:
- Twitter::Client
- Defined in:
- lib/twitter/client/suggested_users.rb
Overview
Defines methods related to users
Instance Method Summary collapse
-
#suggest_users(slug, options = {}) ⇒ Array<Twitter::User>
Access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.
- #suggestions(*args) ⇒ Object
Instance Method Details
#suggest_users(slug, options = {}) ⇒ Array<Twitter::User>
Access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user
52 53 54 55 56 |
# File 'lib/twitter/client/suggested_users.rb', line 52 def suggest_users(slug, ={}) get("/1/users/suggestions/#{slug}/members.json", ).map do |user| Twitter::User.new(user) end end |
#suggestions(options = {}) ⇒ Array<Twitter::Suggestion> #suggestions(slug, options = {}) ⇒ Array<Twitter::Suggestion>
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/twitter/client/suggested_users.rb', line 30 def suggestions(*args) = args.last.is_a?(Hash) ? args.pop : {} if slug = args.first suggestion = get("/1/users/suggestions/#{slug}.json", ) Twitter::Suggestion.new(suggestion) else get("/1/users/suggestions.json", ).map do |suggestion| Twitter::Suggestion.new(suggestion) end end end |