Class: InstagramApi::User
- Inherits:
-
Object
- Object
- InstagramApi::User
show all
- Includes:
- Resource, Search
- Defined in:
- lib/instagram_api/user.rb
Overview
Defines methods which correspond to User resource
Constant Summary
Constants included
from Client
Client::BASE_API_URI, Client::ERROR_CODES
Instance Method Summary
collapse
Methods included from Search
#search
Constructor Details
#initialize(user_id) ⇒ User
User instance constructor. Accepts the user_id
or refers to self
12
13
14
|
# File 'lib/instagram_api/user.rb', line 12
def initialize(user_id)
@user_id = user_id || 'self'
end
|
Instance Method Details
#change_relationship(user_id, options = {}) ⇒ Object
54
55
56
|
# File 'lib/instagram_api/user.rb', line 54
def change_relationship(user_id, options = {})
make_request resource_path("#{user_id}/relationship"), { body: options }, :post
end
|
#check_relationship(user_id, options = {}) ⇒ Object
50
51
52
|
# File 'lib/instagram_api/user.rb', line 50
def check_relationship(user_id, options = {})
make_request resource_path("#{user_id}/relationship"), query: options
end
|
#followed_by(options = {}) ⇒ Object
42
43
44
|
# File 'lib/instagram_api/user.rb', line 42
def followed_by(options = {})
make_request resource_path('self/followed-by'), query: options
end
|
#follows(options = {}) ⇒ Object
38
39
40
|
# File 'lib/instagram_api/user.rb', line 38
def follows(options = {})
make_request resource_path('self/follows'), query: options
end
|
34
35
36
|
# File 'lib/instagram_api/user.rb', line 34
def liked_media(options = {})
index @user_id, 'media/liked', options
end
|
30
31
32
|
# File 'lib/instagram_api/user.rb', line 30
def recent_media(options = {})
index @user_id, 'media/recent', options
end
|
#requested_by(options = {}) ⇒ Object
46
47
48
|
# File 'lib/instagram_api/user.rb', line 46
def requested_by(options = {})
make_request resource_path('self/requested-by'), query: options
end
|
#show(options = {}) ⇒ Hashie::Mash
Returns an information about the given user
26
27
28
|
# File 'lib/instagram_api/user.rb', line 26
def show(options = {})
super @user_id, options
end
|