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 = {}) ⇒ Array
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 |
# File 'lib/instagram/client/users.rb', line 18 def user(*args) id = args.first || 'self' response = get("users/#{id}") response["data"] 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
62 63 64 65 66 67 |
# File 'lib/instagram/client/users.rb', line 62 def user_follows(*args) = args.last.is_a?(Hash) ? args.pop : {} id = args.first || "self" response = get("users/#{id}/follows", ) response["data"] end |
#user_search(query, options = {}) ⇒ Array
Returns users that match the given query
36 37 38 39 |
# File 'lib/instagram/client/users.rb', line 36 def user_search(query, ={}) response = get('users/search', .merge(:q => query)) response["data"] end |