pinterest-ruby 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.rubocop.yml +63 -0
- data/.travis-gemfile +17 -0
- data/.travis.yml +12 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +24 -0
- data/README.md +34 -0
- data/Rakefile +44 -0
- data/docs/FaradayMiddleware/SafeOj.html +218 -0
- data/docs/FaradayMiddleware.html +125 -0
- data/docs/Pinterest/Board.html +410 -0
- data/docs/Pinterest/Client.html +1894 -0
- data/docs/Pinterest/Collection.html +1877 -0
- data/docs/Pinterest/Endpoints/Authentication.html +578 -0
- data/docs/Pinterest/Endpoints/Boards.html +1443 -0
- data/docs/Pinterest/Endpoints/Pins.html +1296 -0
- data/docs/Pinterest/Endpoints/Users.html +1220 -0
- data/docs/Pinterest/Endpoints.html +127 -0
- data/docs/Pinterest/Entity.html +473 -0
- data/docs/Pinterest/Errors/AuthorizationError.html +158 -0
- data/docs/Pinterest/Errors/BadRequestError.html +158 -0
- data/docs/Pinterest/Errors/BaseError.html +487 -0
- data/docs/Pinterest/Errors/MethodNotAllowedError.html +158 -0
- data/docs/Pinterest/Errors/NotFoundError.html +158 -0
- data/docs/Pinterest/Errors/NotImplementedError.html +158 -0
- data/docs/Pinterest/Errors/PermissionsError.html +158 -0
- data/docs/Pinterest/Errors/RateLimitError.html +158 -0
- data/docs/Pinterest/Errors/ServerError.html +158 -0
- data/docs/Pinterest/Errors/TimeoutError.html +158 -0
- data/docs/Pinterest/Errors.html +377 -0
- data/docs/Pinterest/Image.html +617 -0
- data/docs/Pinterest/Interest.html +402 -0
- data/docs/Pinterest/Pin.html +511 -0
- data/docs/Pinterest/User.html +408 -0
- data/docs/Pinterest/Version.html +187 -0
- data/docs/Pinterest.html +130 -0
- data/docs/_index.html +401 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +492 -0
- data/docs/file.README.html +106 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +106 -0
- data/docs/js/app.js +243 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +643 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/pinterest/client.rb +146 -0
- data/lib/pinterest/collection.rb +97 -0
- data/lib/pinterest/endpoints/authentication.rb +99 -0
- data/lib/pinterest/endpoints/boards.rb +193 -0
- data/lib/pinterest/endpoints/pins.rb +187 -0
- data/lib/pinterest/endpoints/users.rb +158 -0
- data/lib/pinterest/errors.rb +94 -0
- data/lib/pinterest/models/board.rb +34 -0
- data/lib/pinterest/models/entity.rb +42 -0
- data/lib/pinterest/models/image.rb +49 -0
- data/lib/pinterest/models/interest.rb +30 -0
- data/lib/pinterest/models/pin.rb +43 -0
- data/lib/pinterest/models/user.rb +33 -0
- data/lib/pinterest/safe_oj.rb +25 -0
- data/lib/pinterest/version.rb +23 -0
- data/lib/pinterest.rb +31 -0
- data/pinterest.gemspec +32 -0
- data/spec/cassettes/Pinterest_Client/_perform_network_request_private_/should_correctly_handle_malformed_requests.yml +51 -0
- data/spec/cassettes/Pinterest_Endpoints_Authentication/_fetch_access_token/should_make_the_call_to_Pinterest_and_return_the_authorization_token_also_saving_it.yml +58 -0
- data/spec/cassettes/Pinterest_Endpoints_Authentication/_verify_access_token/should_return_an_exception_when_using_an_invalid_token.yml +52 -0
- data/spec/cassettes/Pinterest_Endpoints_Authentication/_verify_access_token/should_verify_the_token.yml +59 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_board/should_complain_for_invalid_boards.yml +48 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_board/should_get_the_current_informations.yml +63 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_board/should_restrict_to_requested_fields.yml +57 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_boards/should_only_get_requested_fields.yml +57 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_boards/should_return_a_list_of_boards.yml +74 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_create_board/should_create_the_board_and_return_it_with_only_the_requested_fields.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_delete_board/should_perform_the_call_and_return_an_error.yml +48 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_delete_board/should_perform_the_call_and_return_true.yml +109 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_edit_board/should_edit_the_board_and_return_it_with_only_the_requested_fields.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_follow_board/should_complain_for_invalid_boards.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_follow_board/should_perform_the_call_and_return_true.yml +109 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_following_boards/should_only_get_requested_fields.yml +59 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_following_boards/should_paginate_correctly.yml +72 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_following_boards/should_return_the_followed_boards.yml +72 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_search_my_boards/should_only_get_requested_fields.yml +59 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_search_my_boards/should_paginate_correctly.yml +66 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_search_my_boards/should_search_boards.yml +75 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_suggested_boards/should_return_the_suggested_boards_returning_only_the_requested_fields.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_unfollow_board/should_complain_for_invalid_boards.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Boards/_unfollow_board/should_perform_the_call_and_return_true.yml +109 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_board_pins/should_only_get_requested_fields.yml +59 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_board_pins/should_paginate_correctly.yml +85 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_board_pins/should_return_the_pins_of_the_board.yml +85 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_create_pin/should_create_a_pin_by_using_a_image_URL.yml +71 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_create_pin/should_create_a_pin_by_using_a_image_file.yml +1997 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_create_pin/should_return_a_pin_containing_only_requested_fields.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_delete_pin/should_perform_the_call_and_return_an_error.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_delete_pin/should_perform_the_call_and_return_true.yml +109 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_edit_pin/should_edit_the_pin_and_return_it_with_only_the_requested_fields.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_likes/should_only_get_requested_fields.yml +58 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_likes/should_paginate_correctly.yml +87 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_likes/should_return_the_list_of_liked_pins.yml +85 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_pin/should_complain_for_non_existent_pins.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_pin/should_get_the_current_informations.yml +71 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_pin/should_restrict_to_requested_fields.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_pins/should_only_get_requested_fields.yml +59 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_pins/should_paginate_correctly.yml +808 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_pins/should_return_my_pins.yml +88 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_search_my_pins/should_only_get_requested_fields.yml +61 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_search_my_pins/should_paginate_correctly.yml +89 -0
- data/spec/cassettes/Pinterest_Endpoints_Pins/_search_my_pins/should_search_my_pins.yml +89 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_follow_interest/should_perform_the_call_and_return_an_error.yml +48 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_follow_user/should_complain_for_invalid_users.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_follow_user/should_perform_the_call_and_return_true.yml +109 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_followers/should_only_get_requested_fields.yml +62 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_followers/should_paginate_correctly.yml +62 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_followers/should_return_a_list_of_followers.yml +62 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_following_users/should_only_get_requested_fields.yml +62 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_following_users/should_paginate_correctly.yml +131 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_following_users/should_return_a_list_of_followed_users.yml +66 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_interests/should_paginate_correctly.yml +112 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_interests/should_return_a_list_of_followed_interest.yml +58 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_me/should_get_the_current_informations.yml +62 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_me/should_restrict_to_requested_fields.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_unfollow_interest/should_perform_the_call_and_return_an_error.yml +48 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_unfollow_user/should_complain_for_invalid_users.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_unfollow_user/should_perform_the_call_and_return_true.yml +109 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_user/should_complain_for_non_existent_users.yml +56 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_user/should_get_the_current_informations.yml +60 -0
- data/spec/cassettes/Pinterest_Endpoints_Users/_user/should_restrict_to_requested_fields.yml +56 -0
- data/spec/pinterest/client_spec.rb +70 -0
- data/spec/pinterest/collection_spec.rb +82 -0
- data/spec/pinterest/endpoints/authentication_spec.rb +81 -0
- data/spec/pinterest/endpoints/boards_spec.rb +209 -0
- data/spec/pinterest/endpoints/pins_spec.rb +239 -0
- data/spec/pinterest/endpoints/users_spec.rb +194 -0
- data/spec/pinterest/errors_spec.rb +59 -0
- data/spec/pinterest/fixtures/first.jpg +0 -0
- data/spec/pinterest/models/board_spec.rb +48 -0
- data/spec/pinterest/models/entity_spec.rb +35 -0
- data/spec/pinterest/models/image_spec.rb +50 -0
- data/spec/pinterest/models/interest_spec.rb +20 -0
- data/spec/pinterest/models/pin_spec.rb +55 -0
- data/spec/pinterest/models/user_spec.rb +45 -0
- data/spec/spec_helper.rb +49 -0
- data/tester.rb +19 -0
- metadata +341 -0
@@ -0,0 +1,1220 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: Pinterest::Endpoints::Users
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.7
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Pinterest::Endpoints::Users";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (U)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Pinterest.html" title="Pinterest (module)">Pinterest</a></span></span> » <span class='title'><span class='object_link'><a href="../Endpoints.html" title="Pinterest::Endpoints (module)">Endpoints</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Users</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: Pinterest::Endpoints::Users
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<dl>
|
78
|
+
<dt>Included in:</dt>
|
79
|
+
<dd><span class='object_link'><a href="../Client.html" title="Pinterest::Client (class)">Client</a></span></dd>
|
80
|
+
</dl>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<dl>
|
85
|
+
<dt>Defined in:</dt>
|
86
|
+
<dd>lib/pinterest/endpoints/users.rb</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
92
|
+
<div class="discussion">
|
93
|
+
<p>Users related endpoints.</p>
|
94
|
+
|
95
|
+
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
<div class="tags">
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
Instance Method Summary
|
111
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
112
|
+
</h2>
|
113
|
+
|
114
|
+
<ul class="summary">
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#follow_interest-instance_method" title="#follow_interest (instance method)">#<strong>follow_interest</strong>(interest) ⇒ Boolean </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'><p>Starts following a interest.</p>
|
134
|
+
</div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="#follow_user-instance_method" title="#follow_user (instance method)">#<strong>follow_user</strong>(user) ⇒ Boolean </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<span class="summary_desc"><div class='inline'><p>Follows a user.</p>
|
157
|
+
</div></span>
|
158
|
+
|
159
|
+
</li>
|
160
|
+
|
161
|
+
|
162
|
+
<li class="public ">
|
163
|
+
<span class="summary_signature">
|
164
|
+
|
165
|
+
<a href="#followers-instance_method" title="#followers (instance method)">#<strong>followers</strong>(fields: nil, cursor: nil, limit: nil) ⇒ Pinterest::Collection </a>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
</span>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<span class="summary_desc"><div class='inline'><p>Returns the list of users who follow the authenticated user.</p>
|
180
|
+
</div></span>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
|
185
|
+
<li class="public ">
|
186
|
+
<span class="summary_signature">
|
187
|
+
|
188
|
+
<a href="#following_users-instance_method" title="#following_users (instance method)">#<strong>following_users</strong>(fields: nil, cursor: nil, limit: nil) ⇒ Pinterest::Collection </a>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
</span>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<span class="summary_desc"><div class='inline'><p>Returns the list of users followed by the authenticated user.</p>
|
203
|
+
</div></span>
|
204
|
+
|
205
|
+
</li>
|
206
|
+
|
207
|
+
|
208
|
+
<li class="public ">
|
209
|
+
<span class="summary_signature">
|
210
|
+
|
211
|
+
<a href="#interests-instance_method" title="#interests (instance method)">#<strong>interests</strong>(cursor: nil, limit: nil) ⇒ Pinterest::Collection </a>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
</span>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<span class="summary_desc"><div class='inline'><p>Returns the list of interests (topics) followed by the authenticated user.</p>
|
226
|
+
</div></span>
|
227
|
+
|
228
|
+
</li>
|
229
|
+
|
230
|
+
|
231
|
+
<li class="public ">
|
232
|
+
<span class="summary_signature">
|
233
|
+
|
234
|
+
<a href="#me-instance_method" title="#me (instance method)">#<strong>me</strong>(fields: nil) ⇒ Pinterest::User </a>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
</span>
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
<span class="summary_desc"><div class='inline'><p>Returns information about the authenticated user.</p>
|
249
|
+
</div></span>
|
250
|
+
|
251
|
+
</li>
|
252
|
+
|
253
|
+
|
254
|
+
<li class="public ">
|
255
|
+
<span class="summary_signature">
|
256
|
+
|
257
|
+
<a href="#unfollow_interest-instance_method" title="#unfollow_interest (instance method)">#<strong>unfollow_interest</strong>(interest) ⇒ Boolean </a>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
</span>
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
<span class="summary_desc"><div class='inline'><p>Stops following a interest.</p>
|
272
|
+
</div></span>
|
273
|
+
|
274
|
+
</li>
|
275
|
+
|
276
|
+
|
277
|
+
<li class="public ">
|
278
|
+
<span class="summary_signature">
|
279
|
+
|
280
|
+
<a href="#unfollow_user-instance_method" title="#unfollow_user (instance method)">#<strong>unfollow_user</strong>(user) ⇒ Boolean </a>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
</span>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
<span class="summary_desc"><div class='inline'><p>Stops following a user.</p>
|
295
|
+
</div></span>
|
296
|
+
|
297
|
+
</li>
|
298
|
+
|
299
|
+
|
300
|
+
<li class="public ">
|
301
|
+
<span class="summary_signature">
|
302
|
+
|
303
|
+
<a href="#user-instance_method" title="#user (instance method)">#<strong>user</strong>(user, fields: nil) ⇒ Pinterest::User </a>
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
</span>
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
<span class="summary_desc"><div class='inline'><p>Returns information about a user.</p>
|
318
|
+
</div></span>
|
319
|
+
|
320
|
+
</li>
|
321
|
+
|
322
|
+
|
323
|
+
</ul>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
<div id="instance_method_details" class="method_details_list">
|
329
|
+
<h2>Instance Method Details</h2>
|
330
|
+
|
331
|
+
|
332
|
+
<div class="method_details first">
|
333
|
+
<h3 class="signature first" id="follow_interest-instance_method">
|
334
|
+
|
335
|
+
#<strong>follow_interest</strong>(interest) ⇒ <tt>Boolean</tt>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
</h3><div class="docstring">
|
342
|
+
<div class="discussion">
|
343
|
+
<p>Starts following a interest.</p>
|
344
|
+
|
345
|
+
<p>NOTE: This is currently returning 405 on the platform. Review ASAP.</p>
|
346
|
+
|
347
|
+
|
348
|
+
</div>
|
349
|
+
</div>
|
350
|
+
<div class="tags">
|
351
|
+
<p class="tag_title">Parameters:</p>
|
352
|
+
<ul class="param">
|
353
|
+
|
354
|
+
<li>
|
355
|
+
|
356
|
+
<span class='name'>interest</span>
|
357
|
+
|
358
|
+
|
359
|
+
<span class='type'>(<tt>Fixnum|String</tt>)</span>
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
—
|
364
|
+
<div class='inline'><p>The interest id.</p>
|
365
|
+
</div>
|
366
|
+
|
367
|
+
</li>
|
368
|
+
|
369
|
+
</ul>
|
370
|
+
|
371
|
+
<p class="tag_title">Returns:</p>
|
372
|
+
<ul class="return">
|
373
|
+
|
374
|
+
<li>
|
375
|
+
|
376
|
+
|
377
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
—
|
382
|
+
<div class='inline'><p><code>true</code> if operation succeeded, <code>false</code> otherwise.</p>
|
383
|
+
</div>
|
384
|
+
|
385
|
+
</li>
|
386
|
+
|
387
|
+
</ul>
|
388
|
+
<p class="tag_title">Raises:</p>
|
389
|
+
<ul class="raise">
|
390
|
+
|
391
|
+
<li>
|
392
|
+
|
393
|
+
|
394
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
</li>
|
399
|
+
|
400
|
+
</ul>
|
401
|
+
|
402
|
+
</div><table class="source_code">
|
403
|
+
<tr>
|
404
|
+
<td>
|
405
|
+
<pre class="lines">
|
406
|
+
|
407
|
+
|
408
|
+
103
|
409
|
+
104
|
410
|
+
105
|
411
|
+
106
|
412
|
+
107
|
413
|
+
108
|
414
|
+
109
|
415
|
+
110</pre>
|
416
|
+
</td>
|
417
|
+
<td>
|
418
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/endpoints/users.rb', line 103</span>
|
419
|
+
|
420
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_follow_interest'>follow_interest</span><span class='lparen'>(</span><span class='id identifier rubyid_interest'>interest</span><span class='rparen'>)</span>
|
421
|
+
<span class='comment'># Validate the interest id
|
422
|
+
</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>You have to specify a interest or its id.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_interest'>interest</span>
|
423
|
+
<span class='id identifier rubyid_interest'>interest</span> <span class='op'>=</span> <span class='id identifier rubyid_interest'>interest</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_interest'>interest</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Pinterest.html" title="Pinterest (module)">Pinterest</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Interest.html" title="Pinterest::Interest (class)">Interest</a></span></span><span class='rparen'>)</span>
|
424
|
+
|
425
|
+
<span class='comment'># Perform the request
|
426
|
+
</span> <span class='id identifier rubyid_perform_network_request'>perform_network_request</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>POST</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='label'>interest:</span> <span class='id identifier rubyid_interest'>interest</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>url:</span> <span class='id identifier rubyid_versioned_url'>versioned_url</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/me/following/interests/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
427
|
+
<span class='kw'>end</span></pre>
|
428
|
+
</td>
|
429
|
+
</tr>
|
430
|
+
</table>
|
431
|
+
</div>
|
432
|
+
|
433
|
+
<div class="method_details ">
|
434
|
+
<h3 class="signature " id="follow_user-instance_method">
|
435
|
+
|
436
|
+
#<strong>follow_user</strong>(user) ⇒ <tt>Boolean</tt>
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
</h3><div class="docstring">
|
443
|
+
<div class="discussion">
|
444
|
+
<p>Follows a user.</p>
|
445
|
+
|
446
|
+
|
447
|
+
</div>
|
448
|
+
</div>
|
449
|
+
<div class="tags">
|
450
|
+
<p class="tag_title">Parameters:</p>
|
451
|
+
<ul class="param">
|
452
|
+
|
453
|
+
<li>
|
454
|
+
|
455
|
+
<span class='name'>user</span>
|
456
|
+
|
457
|
+
|
458
|
+
<span class='type'>(<tt>Fixnum|String</tt>)</span>
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
—
|
463
|
+
<div class='inline'><p>The username or user id.</p>
|
464
|
+
</div>
|
465
|
+
|
466
|
+
</li>
|
467
|
+
|
468
|
+
</ul>
|
469
|
+
|
470
|
+
<p class="tag_title">Returns:</p>
|
471
|
+
<ul class="return">
|
472
|
+
|
473
|
+
<li>
|
474
|
+
|
475
|
+
|
476
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
—
|
481
|
+
<div class='inline'><p><code>true</code> if operation succeeded, <code>false</code> otherwise.</p>
|
482
|
+
</div>
|
483
|
+
|
484
|
+
</li>
|
485
|
+
|
486
|
+
</ul>
|
487
|
+
|
488
|
+
</div><table class="source_code">
|
489
|
+
<tr>
|
490
|
+
<td>
|
491
|
+
<pre class="lines">
|
492
|
+
|
493
|
+
|
494
|
+
60
|
495
|
+
61
|
496
|
+
62
|
497
|
+
63
|
498
|
+
64
|
499
|
+
65
|
500
|
+
66
|
501
|
+
67</pre>
|
502
|
+
</td>
|
503
|
+
<td>
|
504
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/endpoints/users.rb', line 60</span>
|
505
|
+
|
506
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_follow_user'>follow_user</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span>
|
507
|
+
<span class='comment'># Validate the user id
|
508
|
+
</span> <span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_validate_user'>validate_user</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span>
|
509
|
+
|
510
|
+
<span class='comment'># Perform the request
|
511
|
+
</span> <span class='id identifier rubyid_perform_network_request'>perform_network_request</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>POST</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>body:</span> <span class='lbrace'>{</span><span class='label'>user:</span> <span class='id identifier rubyid_user'>user</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>url:</span> <span class='id identifier rubyid_versioned_url'>versioned_url</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/me/following/users/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
512
|
+
<span class='kw'>true</span>
|
513
|
+
<span class='kw'>end</span></pre>
|
514
|
+
</td>
|
515
|
+
</tr>
|
516
|
+
</table>
|
517
|
+
</div>
|
518
|
+
|
519
|
+
<div class="method_details ">
|
520
|
+
<h3 class="signature " id="followers-instance_method">
|
521
|
+
|
522
|
+
#<strong>followers</strong>(fields: nil, cursor: nil, limit: nil) ⇒ <tt><span class='object_link'><a href="../Collection.html" title="Pinterest::Collection (class)">Pinterest::Collection</a></span></tt>
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
|
528
|
+
</h3><div class="docstring">
|
529
|
+
<div class="discussion">
|
530
|
+
<p>Returns the list of users who follow the authenticated user.</p>
|
531
|
+
|
532
|
+
|
533
|
+
</div>
|
534
|
+
</div>
|
535
|
+
<div class="tags">
|
536
|
+
<p class="tag_title">Parameters:</p>
|
537
|
+
<ul class="param">
|
538
|
+
|
539
|
+
<li>
|
540
|
+
|
541
|
+
<span class='name'>fields</span>
|
542
|
+
|
543
|
+
|
544
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
—
|
549
|
+
<div class='inline'><p>A list of fields to return.</p>
|
550
|
+
</div>
|
551
|
+
|
552
|
+
</li>
|
553
|
+
|
554
|
+
<li>
|
555
|
+
|
556
|
+
<span class='name'>cursor</span>
|
557
|
+
|
558
|
+
|
559
|
+
<span class='type'>(<tt>String</tt>)</span>
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
—
|
564
|
+
<div class='inline'><p>A cursor to paginate results, obtained by a previous call.</p>
|
565
|
+
</div>
|
566
|
+
|
567
|
+
</li>
|
568
|
+
|
569
|
+
<li>
|
570
|
+
|
571
|
+
<span class='name'>limit</span>
|
572
|
+
|
573
|
+
|
574
|
+
<span class='type'>(<tt>Fixnum</tt>)</span>
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
—
|
579
|
+
<div class='inline'><p>The maximum number of objects to return.</p>
|
580
|
+
</div>
|
581
|
+
|
582
|
+
</li>
|
583
|
+
|
584
|
+
</ul>
|
585
|
+
|
586
|
+
<p class="tag_title">Returns:</p>
|
587
|
+
<ul class="return">
|
588
|
+
|
589
|
+
<li>
|
590
|
+
|
591
|
+
|
592
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Collection.html" title="Pinterest::Collection (class)">Pinterest::Collection</a></span></tt>)</span>
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
—
|
597
|
+
<div class='inline'><p>An collection of user objects.</p>
|
598
|
+
</div>
|
599
|
+
|
600
|
+
</li>
|
601
|
+
|
602
|
+
</ul>
|
603
|
+
|
604
|
+
</div><table class="source_code">
|
605
|
+
<tr>
|
606
|
+
<td>
|
607
|
+
<pre class="lines">
|
608
|
+
|
609
|
+
|
610
|
+
42
|
611
|
+
43
|
612
|
+
44</pre>
|
613
|
+
</td>
|
614
|
+
<td>
|
615
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/endpoints/users.rb', line 42</span>
|
616
|
+
|
617
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_followers'>followers</span><span class='lparen'>(</span><span class='label'>fields:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>cursor:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
618
|
+
<span class='id identifier rubyid_get_users_collection'>get_users_collection</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/me/followers/</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_fields'>fields</span><span class='comma'>,</span> <span class='id identifier rubyid_cursor'>cursor</span><span class='comma'>,</span> <span class='id identifier rubyid_limit'>limit</span><span class='rparen'>)</span>
|
619
|
+
<span class='kw'>end</span></pre>
|
620
|
+
</td>
|
621
|
+
</tr>
|
622
|
+
</table>
|
623
|
+
</div>
|
624
|
+
|
625
|
+
<div class="method_details ">
|
626
|
+
<h3 class="signature " id="following_users-instance_method">
|
627
|
+
|
628
|
+
#<strong>following_users</strong>(fields: nil, cursor: nil, limit: nil) ⇒ <tt><span class='object_link'><a href="../Collection.html" title="Pinterest::Collection (class)">Pinterest::Collection</a></span></tt>
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
|
634
|
+
</h3><div class="docstring">
|
635
|
+
<div class="discussion">
|
636
|
+
<p>Returns the list of users followed by the authenticated user.</p>
|
637
|
+
|
638
|
+
|
639
|
+
</div>
|
640
|
+
</div>
|
641
|
+
<div class="tags">
|
642
|
+
<p class="tag_title">Parameters:</p>
|
643
|
+
<ul class="param">
|
644
|
+
|
645
|
+
<li>
|
646
|
+
|
647
|
+
<span class='name'>fields</span>
|
648
|
+
|
649
|
+
|
650
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
651
|
+
|
652
|
+
|
653
|
+
|
654
|
+
—
|
655
|
+
<div class='inline'><p>A list of fields to return.</p>
|
656
|
+
</div>
|
657
|
+
|
658
|
+
</li>
|
659
|
+
|
660
|
+
<li>
|
661
|
+
|
662
|
+
<span class='name'>cursor</span>
|
663
|
+
|
664
|
+
|
665
|
+
<span class='type'>(<tt>String</tt>)</span>
|
666
|
+
|
667
|
+
|
668
|
+
|
669
|
+
—
|
670
|
+
<div class='inline'><p>A cursor to paginate results, obtained by a previous call.</p>
|
671
|
+
</div>
|
672
|
+
|
673
|
+
</li>
|
674
|
+
|
675
|
+
<li>
|
676
|
+
|
677
|
+
<span class='name'>limit</span>
|
678
|
+
|
679
|
+
|
680
|
+
<span class='type'>(<tt>Fixnum</tt>)</span>
|
681
|
+
|
682
|
+
|
683
|
+
|
684
|
+
—
|
685
|
+
<div class='inline'><p>The maximum number of objects to return.</p>
|
686
|
+
</div>
|
687
|
+
|
688
|
+
</li>
|
689
|
+
|
690
|
+
</ul>
|
691
|
+
|
692
|
+
<p class="tag_title">Returns:</p>
|
693
|
+
<ul class="return">
|
694
|
+
|
695
|
+
<li>
|
696
|
+
|
697
|
+
|
698
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Collection.html" title="Pinterest::Collection (class)">Pinterest::Collection</a></span></tt>)</span>
|
699
|
+
|
700
|
+
|
701
|
+
|
702
|
+
—
|
703
|
+
<div class='inline'><p>An collection of user objects.</p>
|
704
|
+
</div>
|
705
|
+
|
706
|
+
</li>
|
707
|
+
|
708
|
+
</ul>
|
709
|
+
|
710
|
+
</div><table class="source_code">
|
711
|
+
<tr>
|
712
|
+
<td>
|
713
|
+
<pre class="lines">
|
714
|
+
|
715
|
+
|
716
|
+
52
|
717
|
+
53
|
718
|
+
54</pre>
|
719
|
+
</td>
|
720
|
+
<td>
|
721
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/endpoints/users.rb', line 52</span>
|
722
|
+
|
723
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_following_users'>following_users</span><span class='lparen'>(</span><span class='label'>fields:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>cursor:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
724
|
+
<span class='id identifier rubyid_get_users_collection'>get_users_collection</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/me/following/users/</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_fields'>fields</span><span class='comma'>,</span> <span class='id identifier rubyid_cursor'>cursor</span><span class='comma'>,</span> <span class='id identifier rubyid_limit'>limit</span><span class='rparen'>)</span>
|
725
|
+
<span class='kw'>end</span></pre>
|
726
|
+
</td>
|
727
|
+
</tr>
|
728
|
+
</table>
|
729
|
+
</div>
|
730
|
+
|
731
|
+
<div class="method_details ">
|
732
|
+
<h3 class="signature " id="interests-instance_method">
|
733
|
+
|
734
|
+
#<strong>interests</strong>(cursor: nil, limit: nil) ⇒ <tt><span class='object_link'><a href="../Collection.html" title="Pinterest::Collection (class)">Pinterest::Collection</a></span></tt>
|
735
|
+
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
|
740
|
+
</h3><div class="docstring">
|
741
|
+
<div class="discussion">
|
742
|
+
<p>Returns the list of interests (topics) followed by the authenticated user.</p>
|
743
|
+
|
744
|
+
|
745
|
+
</div>
|
746
|
+
</div>
|
747
|
+
<div class="tags">
|
748
|
+
<p class="tag_title">Parameters:</p>
|
749
|
+
<ul class="param">
|
750
|
+
|
751
|
+
<li>
|
752
|
+
|
753
|
+
<span class='name'>cursor</span>
|
754
|
+
|
755
|
+
|
756
|
+
<span class='type'>(<tt>String</tt>)</span>
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
—
|
761
|
+
<div class='inline'><p>A cursor to paginate results, obtained by a previous call.</p>
|
762
|
+
</div>
|
763
|
+
|
764
|
+
</li>
|
765
|
+
|
766
|
+
<li>
|
767
|
+
|
768
|
+
<span class='name'>limit</span>
|
769
|
+
|
770
|
+
|
771
|
+
<span class='type'>(<tt>Fixnum</tt>)</span>
|
772
|
+
|
773
|
+
|
774
|
+
|
775
|
+
—
|
776
|
+
<div class='inline'><p>The maximum number of objects to return.</p>
|
777
|
+
</div>
|
778
|
+
|
779
|
+
</li>
|
780
|
+
|
781
|
+
</ul>
|
782
|
+
|
783
|
+
<p class="tag_title">Returns:</p>
|
784
|
+
<ul class="return">
|
785
|
+
|
786
|
+
<li>
|
787
|
+
|
788
|
+
|
789
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Collection.html" title="Pinterest::Collection (class)">Pinterest::Collection</a></span></tt>)</span>
|
790
|
+
|
791
|
+
|
792
|
+
|
793
|
+
—
|
794
|
+
<div class='inline'><p>An collection of interest objects.</p>
|
795
|
+
</div>
|
796
|
+
|
797
|
+
</li>
|
798
|
+
|
799
|
+
</ul>
|
800
|
+
|
801
|
+
</div><table class="source_code">
|
802
|
+
<tr>
|
803
|
+
<td>
|
804
|
+
<pre class="lines">
|
805
|
+
|
806
|
+
|
807
|
+
87
|
808
|
+
88
|
809
|
+
89
|
810
|
+
90
|
811
|
+
91
|
812
|
+
92
|
813
|
+
93
|
814
|
+
94
|
815
|
+
95
|
816
|
+
96</pre>
|
817
|
+
</td>
|
818
|
+
<td>
|
819
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/endpoints/users.rb', line 87</span>
|
820
|
+
|
821
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_interests'>interests</span><span class='lparen'>(</span><span class='label'>cursor:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
822
|
+
<span class='comment'># Perform request
|
823
|
+
</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_perform_network_request'>perform_network_request</span><span class='lparen'>(</span>
|
824
|
+
<span class='label'>url:</span> <span class='id identifier rubyid_versioned_url'>versioned_url</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/me/following/interests/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='comma'>,</span>
|
825
|
+
<span class='label'>pagination:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>cursor:</span> <span class='id identifier rubyid_cursor'>cursor</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='id identifier rubyid_limit'>limit</span>
|
826
|
+
<span class='rparen'>)</span>
|
827
|
+
|
828
|
+
<span class='comment'># Create the collection
|
829
|
+
</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Pinterest.html" title="Pinterest (module)">Pinterest</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Collection.html" title="Pinterest::Collection (class)">Collection</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Collection.html#initialize-instance_method" title="Pinterest::Collection#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='comma'>,</span> <span class='id identifier rubyid_cursor'>cursor</span><span class='comma'>,</span> <span class='id identifier rubyid_limit'>limit</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_interest'>interest</span><span class='op'>|</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Pinterest.html" title="Pinterest (module)">Pinterest</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Interest.html" title="Pinterest::Interest (class)">Interest</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create'><span class='object_link'><a href="../Interest.html#create-class_method" title="Pinterest::Interest.create (method)">create</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_interest'>interest</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
830
|
+
<span class='kw'>end</span></pre>
|
831
|
+
</td>
|
832
|
+
</tr>
|
833
|
+
</table>
|
834
|
+
</div>
|
835
|
+
|
836
|
+
<div class="method_details ">
|
837
|
+
<h3 class="signature " id="me-instance_method">
|
838
|
+
|
839
|
+
#<strong>me</strong>(fields: nil) ⇒ <tt><span class='object_link'><a href="../User.html" title="Pinterest::User (class)">Pinterest::User</a></span></tt>
|
840
|
+
|
841
|
+
|
842
|
+
|
843
|
+
|
844
|
+
|
845
|
+
</h3><div class="docstring">
|
846
|
+
<div class="discussion">
|
847
|
+
<p>Returns information about the authenticated user.</p>
|
848
|
+
|
849
|
+
|
850
|
+
</div>
|
851
|
+
</div>
|
852
|
+
<div class="tags">
|
853
|
+
<p class="tag_title">Parameters:</p>
|
854
|
+
<ul class="param">
|
855
|
+
|
856
|
+
<li>
|
857
|
+
|
858
|
+
<span class='name'>fields</span>
|
859
|
+
|
860
|
+
|
861
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
862
|
+
|
863
|
+
|
864
|
+
|
865
|
+
—
|
866
|
+
<div class='inline'><p>A list of fields to return.</p>
|
867
|
+
</div>
|
868
|
+
|
869
|
+
</li>
|
870
|
+
|
871
|
+
</ul>
|
872
|
+
|
873
|
+
<p class="tag_title">Returns:</p>
|
874
|
+
<ul class="return">
|
875
|
+
|
876
|
+
<li>
|
877
|
+
|
878
|
+
|
879
|
+
<span class='type'>(<tt><span class='object_link'><a href="../User.html" title="Pinterest::User (class)">Pinterest::User</a></span></tt>)</span>
|
880
|
+
|
881
|
+
|
882
|
+
|
883
|
+
—
|
884
|
+
<div class='inline'><p>A user object.</p>
|
885
|
+
</div>
|
886
|
+
|
887
|
+
</li>
|
888
|
+
|
889
|
+
</ul>
|
890
|
+
|
891
|
+
</div><table class="source_code">
|
892
|
+
<tr>
|
893
|
+
<td>
|
894
|
+
<pre class="lines">
|
895
|
+
|
896
|
+
|
897
|
+
14
|
898
|
+
15
|
899
|
+
16
|
900
|
+
17
|
901
|
+
18
|
902
|
+
19
|
903
|
+
20</pre>
|
904
|
+
</td>
|
905
|
+
<td>
|
906
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/endpoints/users.rb', line 14</span>
|
907
|
+
|
908
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span><span class='lparen'>(</span><span class='label'>fields:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
909
|
+
<span class='id identifier rubyid_fields'>fields</span> <span class='op'>=</span> <span class='id identifier rubyid_ensure_user_fields'>ensure_user_fields</span><span class='lparen'>(</span><span class='id identifier rubyid_fields'>fields</span><span class='rparen'>)</span>
|
910
|
+
|
911
|
+
<span class='comment'># Perform request and create the user
|
912
|
+
</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_perform_network_request'>perform_network_request</span><span class='lparen'>(</span><span class='label'>url:</span> <span class='id identifier rubyid_versioned_url'>versioned_url</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/me/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_cleanup_params'>cleanup_params</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>fields:</span> <span class='id identifier rubyid_fields'>fields</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
913
|
+
<span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Pinterest.html" title="Pinterest (module)">Pinterest</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../User.html" title="Pinterest::User (class)">User</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create'><span class='object_link'><a href="../User.html#create-class_method" title="Pinterest::User.create (method)">create</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>data</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
914
|
+
<span class='kw'>end</span></pre>
|
915
|
+
</td>
|
916
|
+
</tr>
|
917
|
+
</table>
|
918
|
+
</div>
|
919
|
+
|
920
|
+
<div class="method_details ">
|
921
|
+
<h3 class="signature " id="unfollow_interest-instance_method">
|
922
|
+
|
923
|
+
#<strong>unfollow_interest</strong>(interest) ⇒ <tt>Boolean</tt>
|
924
|
+
|
925
|
+
|
926
|
+
|
927
|
+
|
928
|
+
|
929
|
+
</h3><div class="docstring">
|
930
|
+
<div class="discussion">
|
931
|
+
<p>Stops following a interest.</p>
|
932
|
+
|
933
|
+
<p>NOTE: This is currently returning 404 on the platform. Review ASAP.</p>
|
934
|
+
|
935
|
+
|
936
|
+
</div>
|
937
|
+
</div>
|
938
|
+
<div class="tags">
|
939
|
+
<p class="tag_title">Parameters:</p>
|
940
|
+
<ul class="param">
|
941
|
+
|
942
|
+
<li>
|
943
|
+
|
944
|
+
<span class='name'>interest</span>
|
945
|
+
|
946
|
+
|
947
|
+
<span class='type'>(<tt>Fixnum|String</tt>)</span>
|
948
|
+
|
949
|
+
|
950
|
+
|
951
|
+
—
|
952
|
+
<div class='inline'><p>The interest id.</p>
|
953
|
+
</div>
|
954
|
+
|
955
|
+
</li>
|
956
|
+
|
957
|
+
</ul>
|
958
|
+
|
959
|
+
<p class="tag_title">Returns:</p>
|
960
|
+
<ul class="return">
|
961
|
+
|
962
|
+
<li>
|
963
|
+
|
964
|
+
|
965
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
966
|
+
|
967
|
+
|
968
|
+
|
969
|
+
—
|
970
|
+
<div class='inline'><p><code>true</code> if operation succeeded, <code>false</code> otherwise.</p>
|
971
|
+
</div>
|
972
|
+
|
973
|
+
</li>
|
974
|
+
|
975
|
+
</ul>
|
976
|
+
<p class="tag_title">Raises:</p>
|
977
|
+
<ul class="raise">
|
978
|
+
|
979
|
+
<li>
|
980
|
+
|
981
|
+
|
982
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
983
|
+
|
984
|
+
|
985
|
+
|
986
|
+
</li>
|
987
|
+
|
988
|
+
</ul>
|
989
|
+
|
990
|
+
</div><table class="source_code">
|
991
|
+
<tr>
|
992
|
+
<td>
|
993
|
+
<pre class="lines">
|
994
|
+
|
995
|
+
|
996
|
+
117
|
997
|
+
118
|
998
|
+
119
|
999
|
+
120
|
1000
|
+
121
|
1001
|
+
122
|
1002
|
+
123
|
1003
|
+
124</pre>
|
1004
|
+
</td>
|
1005
|
+
<td>
|
1006
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/endpoints/users.rb', line 117</span>
|
1007
|
+
|
1008
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_unfollow_interest'>unfollow_interest</span><span class='lparen'>(</span><span class='id identifier rubyid_interest'>interest</span><span class='rparen'>)</span>
|
1009
|
+
<span class='comment'># Validate the interest id
|
1010
|
+
</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>You have to specify a interest or its id.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_interest'>interest</span>
|
1011
|
+
<span class='id identifier rubyid_interest'>interest</span> <span class='op'>=</span> <span class='id identifier rubyid_interest'>interest</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_interest'>interest</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Pinterest.html" title="Pinterest (module)">Pinterest</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Interest.html" title="Pinterest::Interest (class)">Interest</a></span></span><span class='rparen'>)</span>
|
1012
|
+
|
1013
|
+
<span class='comment'># Perform the request
|
1014
|
+
</span> <span class='id identifier rubyid_perform_network_request'>perform_network_request</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DELETE</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>url:</span> <span class='id identifier rubyid_versioned_url'>versioned_url</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/me/following/interests/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_interest'>interest</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1015
|
+
<span class='kw'>end</span></pre>
|
1016
|
+
</td>
|
1017
|
+
</tr>
|
1018
|
+
</table>
|
1019
|
+
</div>
|
1020
|
+
|
1021
|
+
<div class="method_details ">
|
1022
|
+
<h3 class="signature " id="unfollow_user-instance_method">
|
1023
|
+
|
1024
|
+
#<strong>unfollow_user</strong>(user) ⇒ <tt>Boolean</tt>
|
1025
|
+
|
1026
|
+
|
1027
|
+
|
1028
|
+
|
1029
|
+
|
1030
|
+
</h3><div class="docstring">
|
1031
|
+
<div class="discussion">
|
1032
|
+
<p>Stops following a user.</p>
|
1033
|
+
|
1034
|
+
|
1035
|
+
</div>
|
1036
|
+
</div>
|
1037
|
+
<div class="tags">
|
1038
|
+
<p class="tag_title">Parameters:</p>
|
1039
|
+
<ul class="param">
|
1040
|
+
|
1041
|
+
<li>
|
1042
|
+
|
1043
|
+
<span class='name'>user</span>
|
1044
|
+
|
1045
|
+
|
1046
|
+
<span class='type'>(<tt>Fixnum|String</tt>)</span>
|
1047
|
+
|
1048
|
+
|
1049
|
+
|
1050
|
+
—
|
1051
|
+
<div class='inline'><p>The username or user id.</p>
|
1052
|
+
</div>
|
1053
|
+
|
1054
|
+
</li>
|
1055
|
+
|
1056
|
+
</ul>
|
1057
|
+
|
1058
|
+
<p class="tag_title">Returns:</p>
|
1059
|
+
<ul class="return">
|
1060
|
+
|
1061
|
+
<li>
|
1062
|
+
|
1063
|
+
|
1064
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1065
|
+
|
1066
|
+
|
1067
|
+
|
1068
|
+
—
|
1069
|
+
<div class='inline'><p><code>true</code> if operation succeeded, <code>false</code> otherwise.</p>
|
1070
|
+
</div>
|
1071
|
+
|
1072
|
+
</li>
|
1073
|
+
|
1074
|
+
</ul>
|
1075
|
+
|
1076
|
+
</div><table class="source_code">
|
1077
|
+
<tr>
|
1078
|
+
<td>
|
1079
|
+
<pre class="lines">
|
1080
|
+
|
1081
|
+
|
1082
|
+
73
|
1083
|
+
74
|
1084
|
+
75
|
1085
|
+
76
|
1086
|
+
77
|
1087
|
+
78
|
1088
|
+
79
|
1089
|
+
80</pre>
|
1090
|
+
</td>
|
1091
|
+
<td>
|
1092
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/endpoints/users.rb', line 73</span>
|
1093
|
+
|
1094
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_unfollow_user'>unfollow_user</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span>
|
1095
|
+
<span class='comment'># Validate the user id
|
1096
|
+
</span> <span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_validate_user'>validate_user</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span>
|
1097
|
+
|
1098
|
+
<span class='comment'># Perform the request
|
1099
|
+
</span> <span class='id identifier rubyid_perform_network_request'>perform_network_request</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DELETE</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>url:</span> <span class='id identifier rubyid_versioned_url'>versioned_url</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/me/following/users/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user'>user</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1100
|
+
<span class='kw'>true</span>
|
1101
|
+
<span class='kw'>end</span></pre>
|
1102
|
+
</td>
|
1103
|
+
</tr>
|
1104
|
+
</table>
|
1105
|
+
</div>
|
1106
|
+
|
1107
|
+
<div class="method_details ">
|
1108
|
+
<h3 class="signature " id="user-instance_method">
|
1109
|
+
|
1110
|
+
#<strong>user</strong>(user, fields: nil) ⇒ <tt><span class='object_link'><a href="../User.html" title="Pinterest::User (class)">Pinterest::User</a></span></tt>
|
1111
|
+
|
1112
|
+
|
1113
|
+
|
1114
|
+
|
1115
|
+
|
1116
|
+
</h3><div class="docstring">
|
1117
|
+
<div class="discussion">
|
1118
|
+
<p>Returns information about a user.</p>
|
1119
|
+
|
1120
|
+
|
1121
|
+
</div>
|
1122
|
+
</div>
|
1123
|
+
<div class="tags">
|
1124
|
+
<p class="tag_title">Parameters:</p>
|
1125
|
+
<ul class="param">
|
1126
|
+
|
1127
|
+
<li>
|
1128
|
+
|
1129
|
+
<span class='name'>user</span>
|
1130
|
+
|
1131
|
+
|
1132
|
+
<span class='type'>(<tt>Fixnum|String</tt>)</span>
|
1133
|
+
|
1134
|
+
|
1135
|
+
|
1136
|
+
—
|
1137
|
+
<div class='inline'><p>The username or user id.</p>
|
1138
|
+
</div>
|
1139
|
+
|
1140
|
+
</li>
|
1141
|
+
|
1142
|
+
<li>
|
1143
|
+
|
1144
|
+
<span class='name'>fields</span>
|
1145
|
+
|
1146
|
+
|
1147
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
1148
|
+
|
1149
|
+
|
1150
|
+
|
1151
|
+
—
|
1152
|
+
<div class='inline'><p>A list of fields to return.</p>
|
1153
|
+
</div>
|
1154
|
+
|
1155
|
+
</li>
|
1156
|
+
|
1157
|
+
</ul>
|
1158
|
+
|
1159
|
+
<p class="tag_title">Returns:</p>
|
1160
|
+
<ul class="return">
|
1161
|
+
|
1162
|
+
<li>
|
1163
|
+
|
1164
|
+
|
1165
|
+
<span class='type'>(<tt><span class='object_link'><a href="../User.html" title="Pinterest::User (class)">Pinterest::User</a></span></tt>)</span>
|
1166
|
+
|
1167
|
+
|
1168
|
+
|
1169
|
+
—
|
1170
|
+
<div class='inline'><p>A user object.</p>
|
1171
|
+
</div>
|
1172
|
+
|
1173
|
+
</li>
|
1174
|
+
|
1175
|
+
</ul>
|
1176
|
+
|
1177
|
+
</div><table class="source_code">
|
1178
|
+
<tr>
|
1179
|
+
<td>
|
1180
|
+
<pre class="lines">
|
1181
|
+
|
1182
|
+
|
1183
|
+
27
|
1184
|
+
28
|
1185
|
+
29
|
1186
|
+
30
|
1187
|
+
31
|
1188
|
+
32
|
1189
|
+
33
|
1190
|
+
34</pre>
|
1191
|
+
</td>
|
1192
|
+
<td>
|
1193
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/endpoints/users.rb', line 27</span>
|
1194
|
+
|
1195
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_user'>user</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='comma'>,</span> <span class='label'>fields:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1196
|
+
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_validate_user'>validate_user</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span>
|
1197
|
+
<span class='id identifier rubyid_fields'>fields</span> <span class='op'>=</span> <span class='id identifier rubyid_ensure_user_fields'>ensure_user_fields</span><span class='lparen'>(</span><span class='id identifier rubyid_fields'>fields</span><span class='rparen'>)</span>
|
1198
|
+
|
1199
|
+
<span class='comment'># Perform request and create the user
|
1200
|
+
</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_perform_network_request'>perform_network_request</span><span class='lparen'>(</span><span class='label'>url:</span> <span class='id identifier rubyid_versioned_url'>versioned_url</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/users/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user'>user</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_cleanup_params'>cleanup_params</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>fields:</span> <span class='id identifier rubyid_fields'>fields</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1201
|
+
<span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Pinterest.html" title="Pinterest (module)">Pinterest</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../User.html" title="Pinterest::User (class)">User</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create'><span class='object_link'><a href="../User.html#create-class_method" title="Pinterest::User.create (method)">create</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>data</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1202
|
+
<span class='kw'>end</span></pre>
|
1203
|
+
</td>
|
1204
|
+
</tr>
|
1205
|
+
</table>
|
1206
|
+
</div>
|
1207
|
+
|
1208
|
+
</div>
|
1209
|
+
|
1210
|
+
</div>
|
1211
|
+
|
1212
|
+
<div id="footer">
|
1213
|
+
Generated on Thu Jan 12 16:28:12 2017 by
|
1214
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1215
|
+
0.9.7 (ruby-2.3.0).
|
1216
|
+
</div>
|
1217
|
+
|
1218
|
+
</div>
|
1219
|
+
</body>
|
1220
|
+
</html>
|