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,617 @@
|
|
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
|
+
Class: Pinterest::Image
|
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::Image";
|
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 (I)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Pinterest.html" title="Pinterest (module)">Pinterest</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Image</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>Class: Pinterest::Image
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Pinterest::Image</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/pinterest/models/image.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
<p>A object representing a Pinterest image.</p>
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
<div class="tags">
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<h2>
|
121
|
+
Instance Method Summary
|
122
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
123
|
+
</h2>
|
124
|
+
|
125
|
+
<ul class="summary">
|
126
|
+
|
127
|
+
<li class="public ">
|
128
|
+
<span class="summary_signature">
|
129
|
+
|
130
|
+
<a href="#as_json-instance_method" title="#as_json (instance method)">#<strong>as_json</strong>(_ = {}) ⇒ Hash </a>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
</span>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<span class="summary_desc"><div class='inline'><p>Serialize the object as a Hash that can be serialized as JSON.</p>
|
145
|
+
</div></span>
|
146
|
+
|
147
|
+
</li>
|
148
|
+
|
149
|
+
|
150
|
+
<li class="public ">
|
151
|
+
<span class="summary_signature">
|
152
|
+
|
153
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(data) ⇒ Pinterest::Board </a>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
</span>
|
158
|
+
|
159
|
+
|
160
|
+
<span class="note title constructor">constructor</span>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'><p>Creates a new image object.</p>
|
170
|
+
</div></span>
|
171
|
+
|
172
|
+
</li>
|
173
|
+
|
174
|
+
|
175
|
+
<li class="public ">
|
176
|
+
<span class="summary_signature">
|
177
|
+
|
178
|
+
<a href="#size-instance_method" title="#size (instance method)">#<strong>size</strong>(version) ⇒ Hash </a>
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
</span>
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
<span class="summary_desc"><div class='inline'><p>Returns the size of a version of the image.</p>
|
193
|
+
</div></span>
|
194
|
+
|
195
|
+
</li>
|
196
|
+
|
197
|
+
|
198
|
+
<li class="public ">
|
199
|
+
<span class="summary_signature">
|
200
|
+
|
201
|
+
<a href="#url-instance_method" title="#url (instance method)">#<strong>url</strong>(version) ⇒ String </a>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
</span>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<span class="summary_desc"><div class='inline'><p>Returns the URL of a version of the image.</p>
|
216
|
+
</div></span>
|
217
|
+
|
218
|
+
</li>
|
219
|
+
|
220
|
+
|
221
|
+
<li class="public ">
|
222
|
+
<span class="summary_signature">
|
223
|
+
|
224
|
+
<a href="#versions-instance_method" title="#versions (instance method)">#<strong>versions</strong> ⇒ Array </a>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
</span>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
<span class="summary_desc"><div class='inline'><p>Returns the possible versions of a image.</p>
|
239
|
+
</div></span>
|
240
|
+
|
241
|
+
</li>
|
242
|
+
|
243
|
+
|
244
|
+
</ul>
|
245
|
+
|
246
|
+
|
247
|
+
<div id="constructor_details" class="method_details_list">
|
248
|
+
<h2>Constructor Details</h2>
|
249
|
+
|
250
|
+
<div class="method_details first">
|
251
|
+
<h3 class="signature first" id="initialize-instance_method">
|
252
|
+
|
253
|
+
#<strong>initialize</strong>(data) ⇒ <tt><span class='object_link'><a href="Board.html" title="Pinterest::Board (class)">Pinterest::Board</a></span></tt>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
</h3><div class="docstring">
|
260
|
+
<div class="discussion">
|
261
|
+
<p>Creates a new image object.</p>
|
262
|
+
|
263
|
+
|
264
|
+
</div>
|
265
|
+
</div>
|
266
|
+
<div class="tags">
|
267
|
+
<p class="tag_title">Parameters:</p>
|
268
|
+
<ul class="param">
|
269
|
+
|
270
|
+
<li>
|
271
|
+
|
272
|
+
<span class='name'>data</span>
|
273
|
+
|
274
|
+
|
275
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
—
|
280
|
+
<div class='inline'><p>The data of the new object.</p>
|
281
|
+
</div>
|
282
|
+
|
283
|
+
</li>
|
284
|
+
|
285
|
+
</ul>
|
286
|
+
|
287
|
+
|
288
|
+
</div><table class="source_code">
|
289
|
+
<tr>
|
290
|
+
<td>
|
291
|
+
<pre class="lines">
|
292
|
+
|
293
|
+
|
294
|
+
13
|
295
|
+
14
|
296
|
+
15</pre>
|
297
|
+
</td>
|
298
|
+
<td>
|
299
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/models/image.rb', line 13</span>
|
300
|
+
|
301
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
302
|
+
<span class='ivar'>@data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span>
|
303
|
+
<span class='kw'>end</span></pre>
|
304
|
+
</td>
|
305
|
+
</tr>
|
306
|
+
</table>
|
307
|
+
</div>
|
308
|
+
|
309
|
+
</div>
|
310
|
+
|
311
|
+
|
312
|
+
<div id="instance_method_details" class="method_details_list">
|
313
|
+
<h2>Instance Method Details</h2>
|
314
|
+
|
315
|
+
|
316
|
+
<div class="method_details first">
|
317
|
+
<h3 class="signature first" id="as_json-instance_method">
|
318
|
+
|
319
|
+
#<strong>as_json</strong>(_ = {}) ⇒ <tt>Hash</tt>
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
</h3><div class="docstring">
|
326
|
+
<div class="discussion">
|
327
|
+
<p>Serialize the object as a Hash that can be serialized as JSON.</p>
|
328
|
+
|
329
|
+
|
330
|
+
</div>
|
331
|
+
</div>
|
332
|
+
<div class="tags">
|
333
|
+
<p class="tag_title">Parameters:</p>
|
334
|
+
<ul class="param">
|
335
|
+
|
336
|
+
<li>
|
337
|
+
|
338
|
+
<span class='name'>_</span>
|
339
|
+
|
340
|
+
|
341
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
342
|
+
|
343
|
+
|
344
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
345
|
+
|
346
|
+
|
347
|
+
—
|
348
|
+
<div class='inline'><p>The options to use to serialize.</p>
|
349
|
+
</div>
|
350
|
+
|
351
|
+
</li>
|
352
|
+
|
353
|
+
</ul>
|
354
|
+
|
355
|
+
<p class="tag_title">Returns:</p>
|
356
|
+
<ul class="return">
|
357
|
+
|
358
|
+
<li>
|
359
|
+
|
360
|
+
|
361
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
—
|
366
|
+
<div class='inline'><p>The serialized object.</p>
|
367
|
+
</div>
|
368
|
+
|
369
|
+
</li>
|
370
|
+
|
371
|
+
</ul>
|
372
|
+
|
373
|
+
</div><table class="source_code">
|
374
|
+
<tr>
|
375
|
+
<td>
|
376
|
+
<pre class="lines">
|
377
|
+
|
378
|
+
|
379
|
+
45
|
380
|
+
46
|
381
|
+
47</pre>
|
382
|
+
</td>
|
383
|
+
<td>
|
384
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/models/image.rb', line 45</span>
|
385
|
+
|
386
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span><span class='lparen'>(</span><span class='id identifier rubyid__'>_</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
387
|
+
<span class='ivar'>@data</span>
|
388
|
+
<span class='kw'>end</span></pre>
|
389
|
+
</td>
|
390
|
+
</tr>
|
391
|
+
</table>
|
392
|
+
</div>
|
393
|
+
|
394
|
+
<div class="method_details ">
|
395
|
+
<h3 class="signature " id="size-instance_method">
|
396
|
+
|
397
|
+
#<strong>size</strong>(version) ⇒ <tt>Hash</tt>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
</h3><div class="docstring">
|
404
|
+
<div class="discussion">
|
405
|
+
<p>Returns the size of a version of the image.</p>
|
406
|
+
|
407
|
+
|
408
|
+
</div>
|
409
|
+
</div>
|
410
|
+
<div class="tags">
|
411
|
+
<p class="tag_title">Parameters:</p>
|
412
|
+
<ul class="param">
|
413
|
+
|
414
|
+
<li>
|
415
|
+
|
416
|
+
<span class='name'>version</span>
|
417
|
+
|
418
|
+
|
419
|
+
<span class='type'>(<tt>String</tt>)</span>
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
—
|
424
|
+
<div class='inline'><p>The version to inspect.</p>
|
425
|
+
</div>
|
426
|
+
|
427
|
+
</li>
|
428
|
+
|
429
|
+
</ul>
|
430
|
+
|
431
|
+
<p class="tag_title">Returns:</p>
|
432
|
+
<ul class="return">
|
433
|
+
|
434
|
+
<li>
|
435
|
+
|
436
|
+
|
437
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
—
|
442
|
+
<div class='inline'><p>A hash with the <code>:width</code> and <code>:height</code> keys.</p>
|
443
|
+
</div>
|
444
|
+
|
445
|
+
</li>
|
446
|
+
|
447
|
+
</ul>
|
448
|
+
|
449
|
+
</div><table class="source_code">
|
450
|
+
<tr>
|
451
|
+
<td>
|
452
|
+
<pre class="lines">
|
453
|
+
|
454
|
+
|
455
|
+
28
|
456
|
+
29
|
457
|
+
30
|
458
|
+
31</pre>
|
459
|
+
</td>
|
460
|
+
<td>
|
461
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/models/image.rb', line 28</span>
|
462
|
+
|
463
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_size'>size</span><span class='lparen'>(</span><span class='id identifier rubyid_version'>version</span><span class='rparen'>)</span>
|
464
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_version'>version</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
|
465
|
+
<span class='lbrace'>{</span><span class='label'>width:</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>width</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>height:</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>height</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rbrace'>}</span>
|
466
|
+
<span class='kw'>end</span></pre>
|
467
|
+
</td>
|
468
|
+
</tr>
|
469
|
+
</table>
|
470
|
+
</div>
|
471
|
+
|
472
|
+
<div class="method_details ">
|
473
|
+
<h3 class="signature " id="url-instance_method">
|
474
|
+
|
475
|
+
#<strong>url</strong>(version) ⇒ <tt>String</tt>
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
</h3><div class="docstring">
|
482
|
+
<div class="discussion">
|
483
|
+
<p>Returns the URL of a version of the image.</p>
|
484
|
+
|
485
|
+
|
486
|
+
</div>
|
487
|
+
</div>
|
488
|
+
<div class="tags">
|
489
|
+
<p class="tag_title">Parameters:</p>
|
490
|
+
<ul class="param">
|
491
|
+
|
492
|
+
<li>
|
493
|
+
|
494
|
+
<span class='name'>version</span>
|
495
|
+
|
496
|
+
|
497
|
+
<span class='type'>(<tt>String</tt>)</span>
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
—
|
502
|
+
<div class='inline'><p>The version to inspect.</p>
|
503
|
+
</div>
|
504
|
+
|
505
|
+
</li>
|
506
|
+
|
507
|
+
</ul>
|
508
|
+
|
509
|
+
<p class="tag_title">Returns:</p>
|
510
|
+
<ul class="return">
|
511
|
+
|
512
|
+
<li>
|
513
|
+
|
514
|
+
|
515
|
+
<span class='type'>(<tt>String</tt>)</span>
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
—
|
520
|
+
<div class='inline'><p>The version URL.</p>
|
521
|
+
</div>
|
522
|
+
|
523
|
+
</li>
|
524
|
+
|
525
|
+
</ul>
|
526
|
+
|
527
|
+
</div><table class="source_code">
|
528
|
+
<tr>
|
529
|
+
<td>
|
530
|
+
<pre class="lines">
|
531
|
+
|
532
|
+
|
533
|
+
37
|
534
|
+
38
|
535
|
+
39</pre>
|
536
|
+
</td>
|
537
|
+
<td>
|
538
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/models/image.rb', line 37</span>
|
539
|
+
|
540
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_url'>url</span><span class='lparen'>(</span><span class='id identifier rubyid_version'>version</span><span class='rparen'>)</span>
|
541
|
+
<span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_version'>version</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>url</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
|
542
|
+
<span class='kw'>end</span></pre>
|
543
|
+
</td>
|
544
|
+
</tr>
|
545
|
+
</table>
|
546
|
+
</div>
|
547
|
+
|
548
|
+
<div class="method_details ">
|
549
|
+
<h3 class="signature " id="versions-instance_method">
|
550
|
+
|
551
|
+
#<strong>versions</strong> ⇒ <tt>Array</tt>
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
</h3><div class="docstring">
|
558
|
+
<div class="discussion">
|
559
|
+
<p>Returns the possible versions of a image.</p>
|
560
|
+
|
561
|
+
|
562
|
+
</div>
|
563
|
+
</div>
|
564
|
+
<div class="tags">
|
565
|
+
|
566
|
+
<p class="tag_title">Returns:</p>
|
567
|
+
<ul class="return">
|
568
|
+
|
569
|
+
<li>
|
570
|
+
|
571
|
+
|
572
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
—
|
577
|
+
<div class='inline'><p>A list of possible version of a image.</p>
|
578
|
+
</div>
|
579
|
+
|
580
|
+
</li>
|
581
|
+
|
582
|
+
</ul>
|
583
|
+
|
584
|
+
</div><table class="source_code">
|
585
|
+
<tr>
|
586
|
+
<td>
|
587
|
+
<pre class="lines">
|
588
|
+
|
589
|
+
|
590
|
+
20
|
591
|
+
21
|
592
|
+
22</pre>
|
593
|
+
</td>
|
594
|
+
<td>
|
595
|
+
<pre class="code"><span class="info file"># File 'lib/pinterest/models/image.rb', line 20</span>
|
596
|
+
|
597
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_versions'>versions</span>
|
598
|
+
<span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
599
|
+
<span class='kw'>end</span></pre>
|
600
|
+
</td>
|
601
|
+
</tr>
|
602
|
+
</table>
|
603
|
+
</div>
|
604
|
+
|
605
|
+
</div>
|
606
|
+
|
607
|
+
</div>
|
608
|
+
|
609
|
+
<div id="footer">
|
610
|
+
Generated on Thu Jan 12 16:28:13 2017 by
|
611
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
612
|
+
0.9.7 (ruby-2.3.0).
|
613
|
+
</div>
|
614
|
+
|
615
|
+
</div>
|
616
|
+
</body>
|
617
|
+
</html>
|