strawberry_api 0.1.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 +9 -0
- data/.rubocop.yml +4 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +135 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/HTTParty/Response.html +148 -0
- data/doc/StrawberryAPI/AccessRight.html +431 -0
- data/doc/StrawberryAPI/ApiKey.html +637 -0
- data/doc/StrawberryAPI/ArchiveStrategy.html +365 -0
- data/doc/StrawberryAPI/ArchiveStrategyState.html +1057 -0
- data/doc/StrawberryAPI/Asset.html +1791 -0
- data/doc/StrawberryAPI/AssetCopyToStrategy.html +145 -0
- data/doc/StrawberryAPI/AssetFeedback.html +370 -0
- data/doc/StrawberryAPI/Client/ApiKeys.html +904 -0
- data/doc/StrawberryAPI/Client/ArchiveStrategies.html +784 -0
- data/doc/StrawberryAPI/Client/AssetCopyToStrategies.html +805 -0
- data/doc/StrawberryAPI/Client/AssetFeedbacks.html +232 -0
- data/doc/StrawberryAPI/Client/Assets.html +888 -0
- data/doc/StrawberryAPI/Client/Collections.html +319 -0
- data/doc/StrawberryAPI/Client/CopyToFeedbacks.html +232 -0
- data/doc/StrawberryAPI/Client/CustomMetadata.html +210 -0
- data/doc/StrawberryAPI/Client/CustomMetadataFields.html +214 -0
- data/doc/StrawberryAPI/Client/CustomMetadataOptions.html +214 -0
- data/doc/StrawberryAPI/Client/CustomMetadataSets.html +214 -0
- data/doc/StrawberryAPI/Client/Edits.html +485 -0
- data/doc/StrawberryAPI/Client/Features.html +319 -0
- data/doc/StrawberryAPI/Client/Libraries.html +321 -0
- data/doc/StrawberryAPI/Client/Markers.html +234 -0
- data/doc/StrawberryAPI/Client/ProjectCopyToStrategies.html +857 -0
- data/doc/StrawberryAPI/Client/ProjectFeedbacks.html +232 -0
- data/doc/StrawberryAPI/Client/Projects.html +2764 -0
- data/doc/StrawberryAPI/Client/Roles.html +214 -0
- data/doc/StrawberryAPI/Client/Schedules.html +319 -0
- data/doc/StrawberryAPI/Client/Searches.html +293 -0
- data/doc/StrawberryAPI/Client/Sessions.html +376 -0
- data/doc/StrawberryAPI/Client/Settings.html +210 -0
- data/doc/StrawberryAPI/Client/StatusFlags.html +315 -0
- data/doc/StrawberryAPI/Client/Teams.html +1067 -0
- data/doc/StrawberryAPI/Client/Templates.html +319 -0
- data/doc/StrawberryAPI/Client/Users.html +1255 -0
- data/doc/StrawberryAPI/Client.html +487 -0
- data/doc/StrawberryAPI/Collection.html +427 -0
- data/doc/StrawberryAPI/Configuration.html +481 -0
- data/doc/StrawberryAPI/CopyToFeedback.html +220 -0
- data/doc/StrawberryAPI/CustomMetadataField.html +999 -0
- data/doc/StrawberryAPI/CustomMetadataOption.html +567 -0
- data/doc/StrawberryAPI/CustomMetadataSet.html +649 -0
- data/doc/StrawberryAPI/CustomMetadatum.html +718 -0
- data/doc/StrawberryAPI/Edit.html +637 -0
- data/doc/StrawberryAPI/Feature.html +567 -0
- data/doc/StrawberryAPI/Feedback.html +641 -0
- data/doc/StrawberryAPI/HttpClient.html +971 -0
- data/doc/StrawberryAPI/Library.html +637 -0
- data/doc/StrawberryAPI/Marker.html +847 -0
- data/doc/StrawberryAPI/Project.html +2395 -0
- data/doc/StrawberryAPI/ProjectCopyToStrategy.html +365 -0
- data/doc/StrawberryAPI/ProjectFeedback.html +370 -0
- data/doc/StrawberryAPI/Proxy.html +1267 -0
- data/doc/StrawberryAPI/Role.html +567 -0
- data/doc/StrawberryAPI/Schedule.html +2387 -0
- data/doc/StrawberryAPI/Session.html +121 -0
- data/doc/StrawberryAPI/Setting.html +207 -0
- data/doc/StrawberryAPI/StatusFlag.html +207 -0
- data/doc/StrawberryAPI/Strategy.html +641 -0
- data/doc/StrawberryAPI/Team.html +789 -0
- data/doc/StrawberryAPI/Template.html +707 -0
- data/doc/StrawberryAPI/User.html +999 -0
- data/doc/StrawberryAPI.html +483 -0
- data/doc/_index.html +632 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +222 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +222 -0
- data/doc/js/app.js +292 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +3059 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/strawberry_api/access_right.rb +18 -0
- data/lib/strawberry_api/api_key.rb +19 -0
- data/lib/strawberry_api/asset.rb +51 -0
- data/lib/strawberry_api/client/api_keys.rb +49 -0
- data/lib/strawberry_api/client/archive_strategies.rb +87 -0
- data/lib/strawberry_api/client/asset_copy_to_strategies.rb +83 -0
- data/lib/strawberry_api/client/asset_feedbacks.rb +18 -0
- data/lib/strawberry_api/client/assets.rb +92 -0
- data/lib/strawberry_api/client/collections.rb +29 -0
- data/lib/strawberry_api/client/copy_to_feedbacks.rb +18 -0
- data/lib/strawberry_api/client/custom_metadata.rb +16 -0
- data/lib/strawberry_api/client/custom_metadata_fields.rb +18 -0
- data/lib/strawberry_api/client/custom_metadata_options.rb +18 -0
- data/lib/strawberry_api/client/custom_metadata_sets.rb +18 -0
- data/lib/strawberry_api/client/edits.rb +47 -0
- data/lib/strawberry_api/client/features.rb +29 -0
- data/lib/strawberry_api/client/libraries.rb +30 -0
- data/lib/strawberry_api/client/markers.rb +19 -0
- data/lib/strawberry_api/client/project_copy_to_strategies.rb +88 -0
- data/lib/strawberry_api/client/project_feedbacks.rb +18 -0
- data/lib/strawberry_api/client/projects.rb +305 -0
- data/lib/strawberry_api/client/roles.rb +18 -0
- data/lib/strawberry_api/client/schedules.rb +29 -0
- data/lib/strawberry_api/client/searches.rb +25 -0
- data/lib/strawberry_api/client/sessions.rb +33 -0
- data/lib/strawberry_api/client/settings.rb +16 -0
- data/lib/strawberry_api/client/status_flags.rb +27 -0
- data/lib/strawberry_api/client/teams.rb +107 -0
- data/lib/strawberry_api/client/templates.rb +29 -0
- data/lib/strawberry_api/client/users.rb +125 -0
- data/lib/strawberry_api/client.rb +95 -0
- data/lib/strawberry_api/collection.rb +16 -0
- data/lib/strawberry_api/configuration.rb +19 -0
- data/lib/strawberry_api/custom_metadata/custom_metadata_field.rb +30 -0
- data/lib/strawberry_api/custom_metadata/custom_metadata_option.rb +18 -0
- data/lib/strawberry_api/custom_metadata/custom_metadata_set.rb +25 -0
- data/lib/strawberry_api/custom_metadatum.rb +30 -0
- data/lib/strawberry_api/edit.rb +19 -0
- data/lib/strawberry_api/feature.rb +18 -0
- data/lib/strawberry_api/feedback/asset_feedback.rb +15 -0
- data/lib/strawberry_api/feedback/copy_to_feedback.rb +12 -0
- data/lib/strawberry_api/feedback/project_feedback.rb +15 -0
- data/lib/strawberry_api/feedback.rb +19 -0
- data/lib/strawberry_api/http_client.rb +135 -0
- data/lib/strawberry_api/library.rb +19 -0
- data/lib/strawberry_api/marker.rb +22 -0
- data/lib/strawberry_api/project.rb +48 -0
- data/lib/strawberry_api/proxy.rb +28 -0
- data/lib/strawberry_api/role.rb +18 -0
- data/lib/strawberry_api/schedule.rb +44 -0
- data/lib/strawberry_api/session.rb +7 -0
- data/lib/strawberry_api/setting.rb +12 -0
- data/lib/strawberry_api/status_flag.rb +12 -0
- data/lib/strawberry_api/strategy/archive_strategy.rb +10 -0
- data/lib/strawberry_api/strategy/archive_strategy_state.rb +25 -0
- data/lib/strawberry_api/strategy/asset_copy_to_strategy.rb +6 -0
- data/lib/strawberry_api/strategy/project_copy_to_strategy.rb +9 -0
- data/lib/strawberry_api/strategy.rb +19 -0
- data/lib/strawberry_api/team.rb +27 -0
- data/lib/strawberry_api/template.rb +20 -0
- data/lib/strawberry_api/user.rb +30 -0
- data/lib/strawberry_api/version.rb +3 -0
- data/lib/strawberry_api.rb +36 -0
- data/samples/README.md +14 -0
- data/samples/list_assets_links.rb +15 -0
- data/samples/list_projects.rb +14 -0
- data/samples/login.rb +18 -0
- data/samples/test.rb +12 -0
- data/strawberry_api.gemspec +40 -0
- metadata +242 -0
@@ -0,0 +1,971 @@
|
|
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: StrawberryAPI::HttpClient
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.16
|
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 = "StrawberryAPI::HttpClient";
|
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 (H)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">HttpClient</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: StrawberryAPI::HttpClient
|
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">StrawberryAPI::HttpClient</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<dl>
|
91
|
+
<dt>Includes:</dt>
|
92
|
+
<dd>HTTParty</dd>
|
93
|
+
</dl>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dl>
|
101
|
+
<dt>Defined in:</dt>
|
102
|
+
<dd>lib/strawberry_api/http_client.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
108
|
+
<div class="discussion">
|
109
|
+
|
110
|
+
<p>Class HttpClient provides a way to query a remote HTTP server It
|
111
|
+
shamelessly uses the HTTParty gem for all the dirty job</p>
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div class="tags">
|
117
|
+
|
118
|
+
<p class="tag_title">Author:</p>
|
119
|
+
<ul class="author">
|
120
|
+
|
121
|
+
<li>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
<div class='inline'>
|
128
|
+
<p>Pierre Lebrun <pierreyves.lebrun@gmail.com></p>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
</li>
|
132
|
+
|
133
|
+
</ul>
|
134
|
+
|
135
|
+
</div><div id="subclasses">
|
136
|
+
<h2>Direct Known Subclasses</h2>
|
137
|
+
<p class="children"><span class='object_link'><a href="Client.html" title="StrawberryAPI::Client (class)">Client</a></span></p>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<h2>
|
148
|
+
Instance Method Summary
|
149
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
150
|
+
</h2>
|
151
|
+
|
152
|
+
<ul class="summary">
|
153
|
+
|
154
|
+
<li class="public ">
|
155
|
+
<span class="summary_signature">
|
156
|
+
|
157
|
+
<a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong>(path, mute_failure: false, **options) ⇒ HTTParty::Response </a>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
</span>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>Overrides HTTPary reponse handling.</p>
|
173
|
+
</div></span>
|
174
|
+
|
175
|
+
</li>
|
176
|
+
|
177
|
+
|
178
|
+
<li class="public ">
|
179
|
+
<span class="summary_signature">
|
180
|
+
|
181
|
+
<a href="#get-instance_method" title="#get (instance method)">#<strong>get</strong>(path, mute_failure: false, **options) ⇒ HTTParty::Response </a>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
</span>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<span class="summary_desc"><div class='inline'>
|
196
|
+
<p>Overrides HTTPary reponse handling.</p>
|
197
|
+
</div></span>
|
198
|
+
|
199
|
+
</li>
|
200
|
+
|
201
|
+
|
202
|
+
<li class="public ">
|
203
|
+
<span class="summary_signature">
|
204
|
+
|
205
|
+
<a href="#handle_response-instance_method" title="#handle_response (instance method)">#<strong>handle_response</strong>(response) ⇒ HTTParty::Response </a>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
</span>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
<span class="summary_desc"><div class='inline'>
|
220
|
+
<p>Handles HTTParty reponse.</p>
|
221
|
+
</div></span>
|
222
|
+
|
223
|
+
</li>
|
224
|
+
|
225
|
+
|
226
|
+
<li class="public ">
|
227
|
+
<span class="summary_signature">
|
228
|
+
|
229
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(**options) ⇒ StrawberryAPI::API:User </a>
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
</span>
|
234
|
+
|
235
|
+
|
236
|
+
<span class="note title constructor">constructor</span>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<span class="summary_desc"><div class='inline'>
|
246
|
+
<p>Logs in and stores authentication session.</p>
|
247
|
+
</div></span>
|
248
|
+
|
249
|
+
</li>
|
250
|
+
|
251
|
+
|
252
|
+
<li class="public ">
|
253
|
+
<span class="summary_signature">
|
254
|
+
|
255
|
+
<a href="#post-instance_method" title="#post (instance method)">#<strong>post</strong>(path, mute_failure: false, **options) ⇒ HTTParty::Response </a>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
</span>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
<span class="summary_desc"><div class='inline'>
|
270
|
+
<p>Overrides HTTPary reponse handling.</p>
|
271
|
+
</div></span>
|
272
|
+
|
273
|
+
</li>
|
274
|
+
|
275
|
+
|
276
|
+
<li class="public ">
|
277
|
+
<span class="summary_signature">
|
278
|
+
|
279
|
+
<a href="#put-instance_method" title="#put (instance method)">#<strong>put</strong>(path, mute_failure: false, **options) ⇒ HTTParty::Response </a>
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
</span>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
<span class="summary_desc"><div class='inline'>
|
294
|
+
<p>Overrides HTTPary reponse handling.</p>
|
295
|
+
</div></span>
|
296
|
+
|
297
|
+
</li>
|
298
|
+
|
299
|
+
|
300
|
+
<li class="public ">
|
301
|
+
<span class="summary_signature">
|
302
|
+
|
303
|
+
<a href="#request-instance_method" title="#request (instance method)">#<strong>request</strong>(method, path, mute_failure: false, **options) ⇒ Object </a>
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
</span>
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
318
|
+
|
319
|
+
</li>
|
320
|
+
|
321
|
+
|
322
|
+
</ul>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
<div id="constructor_details" class="method_details_list">
|
327
|
+
<h2>Constructor Details</h2>
|
328
|
+
|
329
|
+
<div class="method_details first">
|
330
|
+
<h3 class="signature first" id="initialize-instance_method">
|
331
|
+
|
332
|
+
#<strong>initialize</strong>(**options) ⇒ <tt>StrawberryAPI::API:User</tt>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
</h3><div class="docstring">
|
339
|
+
<div class="discussion">
|
340
|
+
|
341
|
+
<p>Logs in and stores authentication session</p>
|
342
|
+
|
343
|
+
|
344
|
+
</div>
|
345
|
+
</div>
|
346
|
+
<div class="tags">
|
347
|
+
<p class="tag_title">Parameters:</p>
|
348
|
+
<ul class="param">
|
349
|
+
|
350
|
+
<li>
|
351
|
+
|
352
|
+
<span class='name'>[String]</span>
|
353
|
+
|
354
|
+
|
355
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
—
|
360
|
+
<div class='inline'>
|
361
|
+
<p>a customizable set of options</p>
|
362
|
+
</div>
|
363
|
+
|
364
|
+
</li>
|
365
|
+
|
366
|
+
</ul>
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
</div><table class="source_code">
|
374
|
+
<tr>
|
375
|
+
<td>
|
376
|
+
<pre class="lines">
|
377
|
+
|
378
|
+
|
379
|
+
32
|
380
|
+
33
|
381
|
+
34
|
382
|
+
35
|
383
|
+
36
|
384
|
+
37
|
385
|
+
38
|
386
|
+
39
|
387
|
+
40
|
388
|
+
41
|
389
|
+
42
|
390
|
+
43
|
391
|
+
44
|
392
|
+
45
|
393
|
+
46
|
394
|
+
47
|
395
|
+
48
|
396
|
+
49
|
397
|
+
50
|
398
|
+
51
|
399
|
+
52
|
400
|
+
53
|
401
|
+
54
|
402
|
+
55
|
403
|
+
56
|
404
|
+
57
|
405
|
+
58
|
406
|
+
59</pre>
|
407
|
+
</td>
|
408
|
+
<td>
|
409
|
+
<pre class="code"><span class="info file"># File 'lib/strawberry_api/http_client.rb', line 32</span>
|
410
|
+
|
411
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
412
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
413
|
+
<span class='id identifier rubyid_username'>username</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'><span class='object_link'><a href="../StrawberryAPI.html#config-class_method" title="StrawberryAPI.config (method)">config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_username'><span class='object_link'><a href="Configuration.html#username-instance_method" title="StrawberryAPI::Configuration#username (method)">username</a></span></span>
|
414
|
+
<span class='id identifier rubyid_password'>password</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'><span class='object_link'><a href="../StrawberryAPI.html#config-class_method" title="StrawberryAPI.config (method)">config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_password'><span class='object_link'><a href="Configuration.html#password-instance_method" title="StrawberryAPI::Configuration#password (method)">password</a></span></span>
|
415
|
+
<span class='id identifier rubyid_api_key'>api_key</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'><span class='object_link'><a href="../StrawberryAPI.html#config-class_method" title="StrawberryAPI.config (method)">config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_api_key'><span class='object_link'><a href="Configuration.html#api_key-instance_method" title="StrawberryAPI::Configuration#api_key (method)">api_key</a></span></span>
|
416
|
+
<span class='kw'>else</span>
|
417
|
+
<span class='id identifier rubyid_username'>username</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:username</span><span class='rbracket'>]</span>
|
418
|
+
<span class='id identifier rubyid_password'>password</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:password</span><span class='rbracket'>]</span>
|
419
|
+
<span class='id identifier rubyid_api_key'>api_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:api_key</span><span class='rbracket'>]</span>
|
420
|
+
<span class='kw'>end</span>
|
421
|
+
|
422
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_base_uri'>base_uri</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'><span class='object_link'><a href="../StrawberryAPI.html#config-class_method" title="StrawberryAPI.config (method)">config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_host'><span class='object_link'><a href="Configuration.html#host-instance_method" title="StrawberryAPI::Configuration#host (method)">host</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/api/v1</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
423
|
+
|
424
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_api_key'>api_key</span>
|
425
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/session</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='label'>Authorization:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Bearer </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_api_key'>api_key</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_success?'>success?</span>
|
426
|
+
|
427
|
+
<span class='ivar'>@headers</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
428
|
+
<span class='ivar'>@headers</span><span class='lbracket'>[</span><span class='symbol'>:Authorization</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Bearer </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_api_key'>api_key</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
429
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_username'>username</span> <span class='op'>&&</span> <span class='id identifier rubyid_password'>password</span>
|
430
|
+
<span class='id identifier rubyid_session'>session</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/session</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='label'>login:</span> <span class='id identifier rubyid_username'>username</span><span class='comma'>,</span> <span class='label'>password:</span> <span class='id identifier rubyid_password'>password</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
431
|
+
<span class='id identifier rubyid_authentication_token'>authentication_token</span> <span class='op'>=</span> <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>authentication_token</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
432
|
+
|
433
|
+
<span class='ivar'>@cookies</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_cookies'>cookies</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
434
|
+
<span class='ivar'>@cookies</span><span class='lbracket'>[</span><span class='symbol'>:_auth_token</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_authentication_token'>authentication_token</span>
|
435
|
+
<span class='kw'>else</span>
|
436
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Invalid credentials provided</span><span class='tstring_end'>'</span></span>
|
437
|
+
<span class='kw'>end</span>
|
438
|
+
<span class='kw'>end</span></pre>
|
439
|
+
</td>
|
440
|
+
</tr>
|
441
|
+
</table>
|
442
|
+
</div>
|
443
|
+
|
444
|
+
</div>
|
445
|
+
|
446
|
+
|
447
|
+
<div id="instance_method_details" class="method_details_list">
|
448
|
+
<h2>Instance Method Details</h2>
|
449
|
+
|
450
|
+
|
451
|
+
<div class="method_details first">
|
452
|
+
<h3 class="signature first" id="delete-instance_method">
|
453
|
+
|
454
|
+
#<strong>delete</strong>(path, mute_failure: false, **options) ⇒ <tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
</h3><div class="docstring">
|
461
|
+
<div class="discussion">
|
462
|
+
|
463
|
+
<p>Overrides HTTPary reponse handling</p>
|
464
|
+
|
465
|
+
|
466
|
+
</div>
|
467
|
+
</div>
|
468
|
+
<div class="tags">
|
469
|
+
<p class="tag_title">Parameters:</p>
|
470
|
+
<ul class="param">
|
471
|
+
|
472
|
+
<li>
|
473
|
+
|
474
|
+
<span class='name'>path</span>
|
475
|
+
|
476
|
+
|
477
|
+
<span class='type'>(<tt>String</tt>)</span>
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
</li>
|
482
|
+
|
483
|
+
<li>
|
484
|
+
|
485
|
+
<span class='name'>mute_failure</span>
|
486
|
+
|
487
|
+
|
488
|
+
<span class='type'>(<tt>String</tt>)</span>
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
—
|
493
|
+
<div class='inline'>
|
494
|
+
<p>Prevents error raise if request fails</p>
|
495
|
+
</div>
|
496
|
+
|
497
|
+
</li>
|
498
|
+
|
499
|
+
</ul>
|
500
|
+
|
501
|
+
<p class="tag_title">Returns:</p>
|
502
|
+
<ul class="return">
|
503
|
+
|
504
|
+
<li>
|
505
|
+
|
506
|
+
|
507
|
+
<span class='type'>(<tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>)</span>
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
—
|
512
|
+
<div class='inline'>
|
513
|
+
<p>API response</p>
|
514
|
+
</div>
|
515
|
+
|
516
|
+
</li>
|
517
|
+
|
518
|
+
</ul>
|
519
|
+
|
520
|
+
</div><table class="source_code">
|
521
|
+
<tr>
|
522
|
+
<td>
|
523
|
+
<pre class="lines">
|
524
|
+
|
525
|
+
|
526
|
+
130
|
527
|
+
131
|
528
|
+
132</pre>
|
529
|
+
</td>
|
530
|
+
<td>
|
531
|
+
<pre class="code"><span class="info file"># File 'lib/strawberry_api/http_client.rb', line 130</span>
|
532
|
+
|
533
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>mute_failure:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
534
|
+
<span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='symbol'>:delete</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>mute_failure:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
535
|
+
<span class='kw'>end</span></pre>
|
536
|
+
</td>
|
537
|
+
</tr>
|
538
|
+
</table>
|
539
|
+
</div>
|
540
|
+
|
541
|
+
<div class="method_details ">
|
542
|
+
<h3 class="signature " id="get-instance_method">
|
543
|
+
|
544
|
+
#<strong>get</strong>(path, mute_failure: false, **options) ⇒ <tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
</h3><div class="docstring">
|
551
|
+
<div class="discussion">
|
552
|
+
|
553
|
+
<p>Overrides HTTPary reponse handling</p>
|
554
|
+
|
555
|
+
|
556
|
+
</div>
|
557
|
+
</div>
|
558
|
+
<div class="tags">
|
559
|
+
<p class="tag_title">Parameters:</p>
|
560
|
+
<ul class="param">
|
561
|
+
|
562
|
+
<li>
|
563
|
+
|
564
|
+
<span class='name'>path</span>
|
565
|
+
|
566
|
+
|
567
|
+
<span class='type'>(<tt>String</tt>)</span>
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
</li>
|
572
|
+
|
573
|
+
<li>
|
574
|
+
|
575
|
+
<span class='name'>mute_failure</span>
|
576
|
+
|
577
|
+
|
578
|
+
<span class='type'>(<tt>String</tt>)</span>
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
—
|
583
|
+
<div class='inline'>
|
584
|
+
<p>Prevents error raise if request fails</p>
|
585
|
+
</div>
|
586
|
+
|
587
|
+
</li>
|
588
|
+
|
589
|
+
</ul>
|
590
|
+
|
591
|
+
<p class="tag_title">Returns:</p>
|
592
|
+
<ul class="return">
|
593
|
+
|
594
|
+
<li>
|
595
|
+
|
596
|
+
|
597
|
+
<span class='type'>(<tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>)</span>
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
—
|
602
|
+
<div class='inline'>
|
603
|
+
<p>API response</p>
|
604
|
+
</div>
|
605
|
+
|
606
|
+
</li>
|
607
|
+
|
608
|
+
</ul>
|
609
|
+
|
610
|
+
</div><table class="source_code">
|
611
|
+
<tr>
|
612
|
+
<td>
|
613
|
+
<pre class="lines">
|
614
|
+
|
615
|
+
|
616
|
+
97
|
617
|
+
98
|
618
|
+
99</pre>
|
619
|
+
</td>
|
620
|
+
<td>
|
621
|
+
<pre class="code"><span class="info file"># File 'lib/strawberry_api/http_client.rb', line 97</span>
|
622
|
+
|
623
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>mute_failure:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
624
|
+
<span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='symbol'>:get</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>mute_failure:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
625
|
+
<span class='kw'>end</span></pre>
|
626
|
+
</td>
|
627
|
+
</tr>
|
628
|
+
</table>
|
629
|
+
</div>
|
630
|
+
|
631
|
+
<div class="method_details ">
|
632
|
+
<h3 class="signature " id="handle_response-instance_method">
|
633
|
+
|
634
|
+
#<strong>handle_response</strong>(response) ⇒ <tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
</h3><div class="docstring">
|
641
|
+
<div class="discussion">
|
642
|
+
|
643
|
+
<p>Handles HTTParty reponse</p>
|
644
|
+
|
645
|
+
|
646
|
+
</div>
|
647
|
+
</div>
|
648
|
+
<div class="tags">
|
649
|
+
<p class="tag_title">Parameters:</p>
|
650
|
+
<ul class="param">
|
651
|
+
|
652
|
+
<li>
|
653
|
+
|
654
|
+
<span class='name'>response</span>
|
655
|
+
|
656
|
+
|
657
|
+
<span class='type'>(<tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>)</span>
|
658
|
+
|
659
|
+
|
660
|
+
|
661
|
+
</li>
|
662
|
+
|
663
|
+
</ul>
|
664
|
+
|
665
|
+
<p class="tag_title">Returns:</p>
|
666
|
+
<ul class="return">
|
667
|
+
|
668
|
+
<li>
|
669
|
+
|
670
|
+
|
671
|
+
<span class='type'>(<tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>)</span>
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
—
|
676
|
+
<div class='inline'>
|
677
|
+
<p>HTTP reponse</p>
|
678
|
+
</div>
|
679
|
+
|
680
|
+
</li>
|
681
|
+
|
682
|
+
</ul>
|
683
|
+
<p class="tag_title">Raises:</p>
|
684
|
+
<ul class="raise">
|
685
|
+
|
686
|
+
<li>
|
687
|
+
|
688
|
+
|
689
|
+
<span class='type'>(<tt>String</tt>)</span>
|
690
|
+
|
691
|
+
|
692
|
+
|
693
|
+
—
|
694
|
+
<div class='inline'>
|
695
|
+
<p>Indicates the reponse error code and information</p>
|
696
|
+
</div>
|
697
|
+
|
698
|
+
</li>
|
699
|
+
|
700
|
+
</ul>
|
701
|
+
|
702
|
+
</div><table class="source_code">
|
703
|
+
<tr>
|
704
|
+
<td>
|
705
|
+
<pre class="lines">
|
706
|
+
|
707
|
+
|
708
|
+
82
|
709
|
+
83
|
710
|
+
84
|
711
|
+
85
|
712
|
+
86
|
713
|
+
87
|
714
|
+
88</pre>
|
715
|
+
</td>
|
716
|
+
<td>
|
717
|
+
<pre class="code"><span class="info file"># File 'lib/strawberry_api/http_client.rb', line 82</span>
|
718
|
+
|
719
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_response'>handle_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
720
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_success?'>success?</span>
|
721
|
+
<span class='id identifier rubyid_response'>response</span>
|
722
|
+
<span class='kw'>else</span>
|
723
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>error</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
724
|
+
<span class='kw'>end</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="post-instance_method">
|
733
|
+
|
734
|
+
#<strong>post</strong>(path, mute_failure: false, **options) ⇒ <tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>
|
735
|
+
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
|
740
|
+
</h3><div class="docstring">
|
741
|
+
<div class="discussion">
|
742
|
+
|
743
|
+
<p>Overrides HTTPary reponse handling</p>
|
744
|
+
|
745
|
+
|
746
|
+
</div>
|
747
|
+
</div>
|
748
|
+
<div class="tags">
|
749
|
+
<p class="tag_title">Parameters:</p>
|
750
|
+
<ul class="param">
|
751
|
+
|
752
|
+
<li>
|
753
|
+
|
754
|
+
<span class='name'>path</span>
|
755
|
+
|
756
|
+
|
757
|
+
<span class='type'>(<tt>String</tt>)</span>
|
758
|
+
|
759
|
+
|
760
|
+
|
761
|
+
</li>
|
762
|
+
|
763
|
+
<li>
|
764
|
+
|
765
|
+
<span class='name'>mute_failure</span>
|
766
|
+
|
767
|
+
|
768
|
+
<span class='type'>(<tt>String</tt>)</span>
|
769
|
+
|
770
|
+
|
771
|
+
|
772
|
+
—
|
773
|
+
<div class='inline'>
|
774
|
+
<p>Prevents error raise if request fails</p>
|
775
|
+
</div>
|
776
|
+
|
777
|
+
</li>
|
778
|
+
|
779
|
+
</ul>
|
780
|
+
|
781
|
+
<p class="tag_title">Returns:</p>
|
782
|
+
<ul class="return">
|
783
|
+
|
784
|
+
<li>
|
785
|
+
|
786
|
+
|
787
|
+
<span class='type'>(<tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>)</span>
|
788
|
+
|
789
|
+
|
790
|
+
|
791
|
+
—
|
792
|
+
<div class='inline'>
|
793
|
+
<p>API response</p>
|
794
|
+
</div>
|
795
|
+
|
796
|
+
</li>
|
797
|
+
|
798
|
+
</ul>
|
799
|
+
|
800
|
+
</div><table class="source_code">
|
801
|
+
<tr>
|
802
|
+
<td>
|
803
|
+
<pre class="lines">
|
804
|
+
|
805
|
+
|
806
|
+
108
|
807
|
+
109
|
808
|
+
110</pre>
|
809
|
+
</td>
|
810
|
+
<td>
|
811
|
+
<pre class="code"><span class="info file"># File 'lib/strawberry_api/http_client.rb', line 108</span>
|
812
|
+
|
813
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>mute_failure:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
814
|
+
<span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='symbol'>:post</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>mute_failure:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
815
|
+
<span class='kw'>end</span></pre>
|
816
|
+
</td>
|
817
|
+
</tr>
|
818
|
+
</table>
|
819
|
+
</div>
|
820
|
+
|
821
|
+
<div class="method_details ">
|
822
|
+
<h3 class="signature " id="put-instance_method">
|
823
|
+
|
824
|
+
#<strong>put</strong>(path, mute_failure: false, **options) ⇒ <tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>
|
825
|
+
|
826
|
+
|
827
|
+
|
828
|
+
|
829
|
+
|
830
|
+
</h3><div class="docstring">
|
831
|
+
<div class="discussion">
|
832
|
+
|
833
|
+
<p>Overrides HTTPary reponse handling</p>
|
834
|
+
|
835
|
+
|
836
|
+
</div>
|
837
|
+
</div>
|
838
|
+
<div class="tags">
|
839
|
+
<p class="tag_title">Parameters:</p>
|
840
|
+
<ul class="param">
|
841
|
+
|
842
|
+
<li>
|
843
|
+
|
844
|
+
<span class='name'>path</span>
|
845
|
+
|
846
|
+
|
847
|
+
<span class='type'>(<tt>String</tt>)</span>
|
848
|
+
|
849
|
+
|
850
|
+
|
851
|
+
</li>
|
852
|
+
|
853
|
+
<li>
|
854
|
+
|
855
|
+
<span class='name'>mute_failure</span>
|
856
|
+
|
857
|
+
|
858
|
+
<span class='type'>(<tt>String</tt>)</span>
|
859
|
+
|
860
|
+
|
861
|
+
|
862
|
+
—
|
863
|
+
<div class='inline'>
|
864
|
+
<p>Prevents error raise if request fails</p>
|
865
|
+
</div>
|
866
|
+
|
867
|
+
</li>
|
868
|
+
|
869
|
+
</ul>
|
870
|
+
|
871
|
+
<p class="tag_title">Returns:</p>
|
872
|
+
<ul class="return">
|
873
|
+
|
874
|
+
<li>
|
875
|
+
|
876
|
+
|
877
|
+
<span class='type'>(<tt><span class='object_link'><a href="../HTTParty/Response.html" title="HTTParty::Response (class)">HTTParty::Response</a></span></tt>)</span>
|
878
|
+
|
879
|
+
|
880
|
+
|
881
|
+
—
|
882
|
+
<div class='inline'>
|
883
|
+
<p>API response</p>
|
884
|
+
</div>
|
885
|
+
|
886
|
+
</li>
|
887
|
+
|
888
|
+
</ul>
|
889
|
+
|
890
|
+
</div><table class="source_code">
|
891
|
+
<tr>
|
892
|
+
<td>
|
893
|
+
<pre class="lines">
|
894
|
+
|
895
|
+
|
896
|
+
119
|
897
|
+
120
|
898
|
+
121</pre>
|
899
|
+
</td>
|
900
|
+
<td>
|
901
|
+
<pre class="code"><span class="info file"># File 'lib/strawberry_api/http_client.rb', line 119</span>
|
902
|
+
|
903
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>mute_failure:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
904
|
+
<span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='symbol'>:put</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>mute_failure:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
905
|
+
<span class='kw'>end</span></pre>
|
906
|
+
</td>
|
907
|
+
</tr>
|
908
|
+
</table>
|
909
|
+
</div>
|
910
|
+
|
911
|
+
<div class="method_details ">
|
912
|
+
<h3 class="signature " id="request-instance_method">
|
913
|
+
|
914
|
+
#<strong>request</strong>(method, path, mute_failure: false, **options) ⇒ <tt>Object</tt>
|
915
|
+
|
916
|
+
|
917
|
+
|
918
|
+
|
919
|
+
|
920
|
+
</h3><table class="source_code">
|
921
|
+
<tr>
|
922
|
+
<td>
|
923
|
+
<pre class="lines">
|
924
|
+
|
925
|
+
|
926
|
+
61
|
927
|
+
62
|
928
|
+
63
|
929
|
+
64
|
930
|
+
65
|
931
|
+
66
|
932
|
+
67
|
933
|
+
68
|
934
|
+
69
|
935
|
+
70
|
936
|
+
71
|
937
|
+
72</pre>
|
938
|
+
</td>
|
939
|
+
<td>
|
940
|
+
<pre class="code"><span class="info file"># File 'lib/strawberry_api/http_client.rb', line 61</span>
|
941
|
+
|
942
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>mute_failure:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
943
|
+
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:headers</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@headers</span>
|
944
|
+
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:cookies</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@cookies</span>
|
945
|
+
|
946
|
+
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
947
|
+
|
948
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_mute_failure'>mute_failure</span>
|
949
|
+
<span class='id identifier rubyid_response'>response</span>
|
950
|
+
<span class='kw'>else</span>
|
951
|
+
<span class='id identifier rubyid_handle_response'>handle_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
952
|
+
<span class='kw'>end</span>
|
953
|
+
<span class='kw'>end</span></pre>
|
954
|
+
</td>
|
955
|
+
</tr>
|
956
|
+
</table>
|
957
|
+
</div>
|
958
|
+
|
959
|
+
</div>
|
960
|
+
|
961
|
+
</div>
|
962
|
+
|
963
|
+
<div id="footer">
|
964
|
+
Generated on Thu Aug 30 12:51:42 2018 by
|
965
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
966
|
+
0.9.16 (ruby-2.5.0).
|
967
|
+
</div>
|
968
|
+
|
969
|
+
</div>
|
970
|
+
</body>
|
971
|
+
</html>
|