Module: Instagram::Client::Users
- Included in:
- Instagram::Client
- Defined in:
- lib/instagram/client/users.rb
Overview
Defines methods related to users
Instance Method Summary collapse
-
#user(id = nil, options = {}) ⇒ Hashie::Mash
Returns extended information of a given user.
-
#user_follows(*args) ⇒ Object
Returns a list of users whom a given user follows.
-
#user_search(query, options = {}) ⇒ Hashie::Mash
Returns users that match the given query.
Instance Method Details
#user(id = nil, options = {}) ⇒ Hashie::Mash
Returns extended information of a given user
18 19 20 21 22 23 |
# File 'lib/instagram/client/users.rb', line 18 def user(*args) = args.last.is_a?(Hash) ? args.pop : {} id = args.first || 'self' response = get("users/#{id}", ) response end |
#user_follows(id = nil, options = {}) ⇒ Hashie::Mash #user_follows(id = nil, options = {}) ⇒ Hashie::Mash
Returns a list of users whom a given user follows
63 64 65 66 67 68 |
# File 'lib/instagram/client/users.rb', line 63 def user_follows(*args) = args.last.is_a?(Hash) ? args.pop : {} id = args.first || "self" response = get("users/#{id}/follows", ) response end |
#user_search(query, options = {}) ⇒ Hashie::Mash
Returns users that match the given query
37 38 39 40 |
# File 'lib/instagram/client/users.rb', line 37 def user_search(query, ={}) response = get('users/search', .merge(:q => query)) response end |