resourcespace-ruby 0.1.1 → 0.1.2
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 +4 -4
- data/.yardoc/checksums +10 -0
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/.yardopts +7 -0
- data/README.md +1 -2
- data/doc/ResourceSpace/AuthenticationError.html +159 -0
- data/doc/ResourceSpace/AuthorizationError.html +159 -0
- data/doc/ResourceSpace/Client.html +2412 -0
- data/doc/ResourceSpace/ClientError.html +159 -0
- data/doc/ResourceSpace/Collection.html +2301 -0
- data/doc/ResourceSpace/Configuration.html +1655 -0
- data/doc/ResourceSpace/ConfigurationError.html +159 -0
- data/doc/ResourceSpace/ConflictError.html +159 -0
- data/doc/ResourceSpace/Error.html +682 -0
- data/doc/ResourceSpace/Metadata.html +2222 -0
- data/doc/ResourceSpace/NetworkError.html +159 -0
- data/doc/ResourceSpace/NotFoundError.html +159 -0
- data/doc/ResourceSpace/ParseError.html +159 -0
- data/doc/ResourceSpace/QuotaExceededError.html +159 -0
- data/doc/ResourceSpace/RateLimitError.html +159 -0
- data/doc/ResourceSpace/Resource.html +2995 -0
- data/doc/ResourceSpace/Search.html +2487 -0
- data/doc/ResourceSpace/ServerError.html +159 -0
- data/doc/ResourceSpace/TimeoutError.html +159 -0
- data/doc/ResourceSpace/UploadError.html +159 -0
- data/doc/ResourceSpace/User.html +2080 -0
- data/doc/ResourceSpace/ValidationError.html +159 -0
- data/doc/ResourceSpace.html +763 -0
- data/doc/_index.html +358 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +503 -0
- data/doc/file.CHANGELOG.html +105 -0
- data/doc/file.LICENSE.html +70 -0
- data/doc/file.README.html +419 -0
- data/doc/file_list.html +69 -0
- data/doc/frames.html +22 -0
- data/doc/index.html +419 -0
- data/doc/js/app.js +344 -0
- data/doc/js/full_list.js +242 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1142 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/resourcespace/version.rb +1 -1
- data/resourcespace-ruby-0.1.0.gem +0 -0
- data/resourcespace-ruby-0.1.1.gem +0 -0
- data/resourcespace-ruby.gemspec +5 -5
- metadata +54 -7
@@ -0,0 +1,763 @@
|
|
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: ResourceSpace
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.37
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "ResourceSpace";
|
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 (R)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">ResourceSpace</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: ResourceSpace
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/resourcespace.rb<span class="defines">,<br />
|
82
|
+
lib/resourcespace/user.rb,<br /> lib/resourcespace/client.rb,<br /> lib/resourcespace/errors.rb,<br /> lib/resourcespace/search.rb,<br /> lib/resourcespace/version.rb,<br /> lib/resourcespace/metadata.rb,<br /> lib/resourcespace/resource.rb,<br /> lib/resourcespace/collection.rb,<br /> lib/resourcespace/configuration.rb</span>
|
83
|
+
</dd>
|
84
|
+
</dl>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<h2>Overview</h2><div class="docstring">
|
89
|
+
<div class="discussion">
|
90
|
+
|
91
|
+
<p>ResourceSpace Ruby client for interacting with ResourceSpace Digital Asset Management API</p>
|
92
|
+
|
93
|
+
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
<div class="tags">
|
97
|
+
|
98
|
+
<div class="examples">
|
99
|
+
<h4 class="tag_title">Examples:</h4>
|
100
|
+
|
101
|
+
|
102
|
+
<h5 class="example_title"><div class='inline'>
|
103
|
+
<p>Basic usage</p>
|
104
|
+
</div></h5>
|
105
|
+
|
106
|
+
<pre class="example code"><code><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'>ResourceSpace</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ResourceSpace/Client.html" title="ResourceSpace::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Client.html#initialize-instance_method" title="ResourceSpace::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span>
|
107
|
+
<span class='label'>url:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://your-resourcespace.com/api/</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
108
|
+
<span class='label'>user:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>your_username</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
109
|
+
<span class='label'>private_key:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>your_private_key</span><span class='tstring_end'>"</span></span>
|
110
|
+
<span class='rparen'>)</span>
|
111
|
+
|
112
|
+
<span class='comment'># Search for resources
|
113
|
+
</span><span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='period'>.</span><span class='id identifier rubyid_do_search'>do_search</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>cat</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
114
|
+
|
115
|
+
<span class='comment'># Upload a file
|
116
|
+
</span><span class='id identifier rubyid_resource'>resource</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_resources'>resources</span><span class='period'>.</span><span class='id identifier rubyid_create_resource'>create_resource</span><span class='lparen'>(</span>
|
117
|
+
<span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>My Image</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
118
|
+
<span class='label'>file:</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>path/to/image.jpg</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
119
|
+
<span class='rparen'>)</span></code></pre>
|
120
|
+
|
121
|
+
</div>
|
122
|
+
|
123
|
+
|
124
|
+
<p class="tag_title">See Also:</p>
|
125
|
+
<ul class="see">
|
126
|
+
|
127
|
+
<li><a href="https://www.resourcespace.com/knowledge-base/api/" target="_parent" title="https://www.resourcespace.com/knowledge-base/api/">https://www.resourcespace.com/knowledge-base/api/</a></li>
|
128
|
+
|
129
|
+
</ul>
|
130
|
+
|
131
|
+
</div><h2>Defined Under Namespace</h2>
|
132
|
+
<p class="children">
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="ResourceSpace/AuthenticationError.html" title="ResourceSpace::AuthenticationError (class)">AuthenticationError</a></span>, <span class='object_link'><a href="ResourceSpace/AuthorizationError.html" title="ResourceSpace::AuthorizationError (class)">AuthorizationError</a></span>, <span class='object_link'><a href="ResourceSpace/Client.html" title="ResourceSpace::Client (class)">Client</a></span>, <span class='object_link'><a href="ResourceSpace/ClientError.html" title="ResourceSpace::ClientError (class)">ClientError</a></span>, <span class='object_link'><a href="ResourceSpace/Collection.html" title="ResourceSpace::Collection (class)">Collection</a></span>, <span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span>, <span class='object_link'><a href="ResourceSpace/ConfigurationError.html" title="ResourceSpace::ConfigurationError (class)">ConfigurationError</a></span>, <span class='object_link'><a href="ResourceSpace/ConflictError.html" title="ResourceSpace::ConflictError (class)">ConflictError</a></span>, <span class='object_link'><a href="ResourceSpace/Error.html" title="ResourceSpace::Error (class)">Error</a></span>, <span class='object_link'><a href="ResourceSpace/Metadata.html" title="ResourceSpace::Metadata (class)">Metadata</a></span>, <span class='object_link'><a href="ResourceSpace/NetworkError.html" title="ResourceSpace::NetworkError (class)">NetworkError</a></span>, <span class='object_link'><a href="ResourceSpace/NotFoundError.html" title="ResourceSpace::NotFoundError (class)">NotFoundError</a></span>, <span class='object_link'><a href="ResourceSpace/ParseError.html" title="ResourceSpace::ParseError (class)">ParseError</a></span>, <span class='object_link'><a href="ResourceSpace/QuotaExceededError.html" title="ResourceSpace::QuotaExceededError (class)">QuotaExceededError</a></span>, <span class='object_link'><a href="ResourceSpace/RateLimitError.html" title="ResourceSpace::RateLimitError (class)">RateLimitError</a></span>, <span class='object_link'><a href="ResourceSpace/Resource.html" title="ResourceSpace::Resource (class)">Resource</a></span>, <span class='object_link'><a href="ResourceSpace/Search.html" title="ResourceSpace::Search (class)">Search</a></span>, <span class='object_link'><a href="ResourceSpace/ServerError.html" title="ResourceSpace::ServerError (class)">ServerError</a></span>, <span class='object_link'><a href="ResourceSpace/TimeoutError.html" title="ResourceSpace::TimeoutError (class)">TimeoutError</a></span>, <span class='object_link'><a href="ResourceSpace/UploadError.html" title="ResourceSpace::UploadError (class)">UploadError</a></span>, <span class='object_link'><a href="ResourceSpace/User.html" title="ResourceSpace::User (class)">User</a></span>, <span class='object_link'><a href="ResourceSpace/ValidationError.html" title="ResourceSpace::ValidationError (class)">ValidationError</a></span>
|
138
|
+
|
139
|
+
|
140
|
+
</p>
|
141
|
+
|
142
|
+
|
143
|
+
<h2>
|
144
|
+
Constant Summary
|
145
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
146
|
+
</h2>
|
147
|
+
|
148
|
+
<dl class="constants">
|
149
|
+
|
150
|
+
<dt id="VERSION-constant" class="">VERSION =
|
151
|
+
<div class="docstring">
|
152
|
+
<div class="discussion">
|
153
|
+
|
154
|
+
<p>The current version of the ResourceSpace Ruby gem</p>
|
155
|
+
|
156
|
+
|
157
|
+
</div>
|
158
|
+
</div>
|
159
|
+
<div class="tags">
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</dt>
|
164
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.1.2</span><span class='tstring_end'>"</span></span></pre></dd>
|
165
|
+
|
166
|
+
</dl>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
173
|
+
<ul class="summary">
|
174
|
+
|
175
|
+
<li class="public ">
|
176
|
+
<span class="summary_signature">
|
177
|
+
|
178
|
+
<a href="#configuration-class_method" title="configuration (class method)">.<strong>configuration</strong> ⇒ Configuration </a>
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
</span>
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<span class="summary_desc"><div class='inline'>
|
196
|
+
<p>Global configuration for the ResourceSpace gem.</p>
|
197
|
+
</div></span>
|
198
|
+
|
199
|
+
</li>
|
200
|
+
|
201
|
+
|
202
|
+
</ul>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
<h2>
|
209
|
+
Class Method Summary
|
210
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
211
|
+
</h2>
|
212
|
+
|
213
|
+
<ul class="summary">
|
214
|
+
|
215
|
+
<li class="public ">
|
216
|
+
<span class="summary_signature">
|
217
|
+
|
218
|
+
<a href="#config-class_method" title="config (class method)">.<strong>config</strong> ⇒ Configuration </a>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
</span>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
<span class="summary_desc"><div class='inline'>
|
233
|
+
<p>Get the current configuration or create a new one.</p>
|
234
|
+
</div></span>
|
235
|
+
|
236
|
+
</li>
|
237
|
+
|
238
|
+
|
239
|
+
<li class="public ">
|
240
|
+
<span class="summary_signature">
|
241
|
+
|
242
|
+
<a href="#configure-class_method" title="configure (class method)">.<strong>configure</strong> {|Configuration| ... } ⇒ Configuration </a>
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
</span>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
<span class="summary_desc"><div class='inline'>
|
257
|
+
<p>Configure the ResourceSpace gem globally.</p>
|
258
|
+
</div></span>
|
259
|
+
|
260
|
+
</li>
|
261
|
+
|
262
|
+
|
263
|
+
<li class="public ">
|
264
|
+
<span class="summary_signature">
|
265
|
+
|
266
|
+
<a href="#from_response-class_method" title="from_response (class method)">.<strong>from_response</strong>(status_code, message = nil, response_body = nil) ⇒ Error </a>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
</span>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
<span class="summary_desc"><div class='inline'>
|
281
|
+
<p>Method to create appropriate error based on HTTP status code.</p>
|
282
|
+
</div></span>
|
283
|
+
|
284
|
+
</li>
|
285
|
+
|
286
|
+
|
287
|
+
<li class="public ">
|
288
|
+
<span class="summary_signature">
|
289
|
+
|
290
|
+
<a href="#reset_config!-class_method" title="reset_config! (class method)">.<strong>reset_config!</strong> ⇒ Configuration </a>
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
</span>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
<span class="summary_desc"><div class='inline'>
|
305
|
+
<p>Reset the configuration to defaults.</p>
|
306
|
+
</div></span>
|
307
|
+
|
308
|
+
</li>
|
309
|
+
|
310
|
+
|
311
|
+
</ul>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
<div id="class_attr_details" class="attr_details">
|
316
|
+
<h2>Class Attribute Details</h2>
|
317
|
+
|
318
|
+
|
319
|
+
<span id="configuration=-class_method"></span>
|
320
|
+
<div class="method_details first">
|
321
|
+
<h3 class="signature first" id="configuration-class_method">
|
322
|
+
|
323
|
+
.<strong>configuration</strong> ⇒ <tt><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></tt>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</h3><div class="docstring">
|
330
|
+
<div class="discussion">
|
331
|
+
|
332
|
+
<p>Global configuration for the ResourceSpace gem</p>
|
333
|
+
|
334
|
+
|
335
|
+
</div>
|
336
|
+
</div>
|
337
|
+
<div class="tags">
|
338
|
+
|
339
|
+
<p class="tag_title">Returns:</p>
|
340
|
+
<ul class="return">
|
341
|
+
|
342
|
+
<li>
|
343
|
+
|
344
|
+
|
345
|
+
<span class='type'>(<tt><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></tt>)</span>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
—
|
350
|
+
<div class='inline'>
|
351
|
+
<p>the global configuration instance</p>
|
352
|
+
</div>
|
353
|
+
|
354
|
+
</li>
|
355
|
+
|
356
|
+
</ul>
|
357
|
+
|
358
|
+
</div><table class="source_code">
|
359
|
+
<tr>
|
360
|
+
<td>
|
361
|
+
<pre class="lines">
|
362
|
+
|
363
|
+
|
364
|
+
37
|
365
|
+
38
|
366
|
+
39</pre>
|
367
|
+
</td>
|
368
|
+
<td>
|
369
|
+
<pre class="code"><span class="info file"># File 'lib/resourcespace.rb', line 37</span>
|
370
|
+
|
371
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_configuration'>configuration</span>
|
372
|
+
<span class='ivar'>@configuration</span>
|
373
|
+
<span class='kw'>end</span></pre>
|
374
|
+
</td>
|
375
|
+
</tr>
|
376
|
+
</table>
|
377
|
+
</div>
|
378
|
+
|
379
|
+
</div>
|
380
|
+
|
381
|
+
|
382
|
+
<div id="class_method_details" class="method_details_list">
|
383
|
+
<h2>Class Method Details</h2>
|
384
|
+
|
385
|
+
|
386
|
+
<div class="method_details first">
|
387
|
+
<h3 class="signature first" id="config-class_method">
|
388
|
+
|
389
|
+
.<strong>config</strong> ⇒ <tt><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></tt>
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
</h3><div class="docstring">
|
396
|
+
<div class="discussion">
|
397
|
+
|
398
|
+
<p>Get the current configuration or create a new one</p>
|
399
|
+
|
400
|
+
|
401
|
+
</div>
|
402
|
+
</div>
|
403
|
+
<div class="tags">
|
404
|
+
|
405
|
+
<p class="tag_title">Returns:</p>
|
406
|
+
<ul class="return">
|
407
|
+
|
408
|
+
<li>
|
409
|
+
|
410
|
+
|
411
|
+
<span class='type'>(<tt><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></tt>)</span>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
—
|
416
|
+
<div class='inline'>
|
417
|
+
<p>the configuration instance</p>
|
418
|
+
</div>
|
419
|
+
|
420
|
+
</li>
|
421
|
+
|
422
|
+
</ul>
|
423
|
+
|
424
|
+
</div><table class="source_code">
|
425
|
+
<tr>
|
426
|
+
<td>
|
427
|
+
<pre class="lines">
|
428
|
+
|
429
|
+
|
430
|
+
60
|
431
|
+
61
|
432
|
+
62</pre>
|
433
|
+
</td>
|
434
|
+
<td>
|
435
|
+
<pre class="code"><span class="info file"># File 'lib/resourcespace.rb', line 60</span>
|
436
|
+
|
437
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_config'>config</span>
|
438
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_configuration'>configuration</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Configuration.html#initialize-instance_method" title="ResourceSpace::Configuration#initialize (method)">new</a></span></span>
|
439
|
+
<span class='kw'>end</span></pre>
|
440
|
+
</td>
|
441
|
+
</tr>
|
442
|
+
</table>
|
443
|
+
</div>
|
444
|
+
|
445
|
+
<div class="method_details ">
|
446
|
+
<h3 class="signature " id="configure-class_method">
|
447
|
+
|
448
|
+
.<strong>configure</strong> {|Configuration| ... } ⇒ <tt><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></tt>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
</h3><div class="docstring">
|
455
|
+
<div class="discussion">
|
456
|
+
|
457
|
+
<p>Configure the ResourceSpace gem globally</p>
|
458
|
+
|
459
|
+
|
460
|
+
</div>
|
461
|
+
</div>
|
462
|
+
<div class="tags">
|
463
|
+
|
464
|
+
<div class="examples">
|
465
|
+
<h4 class="tag_title">Examples:</h4>
|
466
|
+
|
467
|
+
|
468
|
+
<pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="ResourceSpace (module)">ResourceSpace</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'>configure</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
|
469
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://your-resourcespace.com/api/</span><span class='tstring_end'>"</span></span>
|
470
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>your_username</span><span class='tstring_end'>"</span></span>
|
471
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_private_key'>private_key</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>your_private_key</span><span class='tstring_end'>"</span></span>
|
472
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>=</span> <span class='int'>30</span>
|
473
|
+
<span class='kw'>end</span></code></pre>
|
474
|
+
|
475
|
+
</div>
|
476
|
+
|
477
|
+
<p class="tag_title">Yields:</p>
|
478
|
+
<ul class="yield">
|
479
|
+
|
480
|
+
<li>
|
481
|
+
|
482
|
+
|
483
|
+
<span class='type'>(<tt><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></tt>)</span>
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
—
|
488
|
+
<div class='inline'>
|
489
|
+
<p>the configuration instance</p>
|
490
|
+
</div>
|
491
|
+
|
492
|
+
</li>
|
493
|
+
|
494
|
+
</ul>
|
495
|
+
<p class="tag_title">Returns:</p>
|
496
|
+
<ul class="return">
|
497
|
+
|
498
|
+
<li>
|
499
|
+
|
500
|
+
|
501
|
+
<span class='type'>(<tt><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></tt>)</span>
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
—
|
506
|
+
<div class='inline'>
|
507
|
+
<p>the updated configuration</p>
|
508
|
+
</div>
|
509
|
+
|
510
|
+
</li>
|
511
|
+
|
512
|
+
</ul>
|
513
|
+
|
514
|
+
</div><table class="source_code">
|
515
|
+
<tr>
|
516
|
+
<td>
|
517
|
+
<pre class="lines">
|
518
|
+
|
519
|
+
|
520
|
+
51
|
521
|
+
52
|
522
|
+
53
|
523
|
+
54
|
524
|
+
55</pre>
|
525
|
+
</td>
|
526
|
+
<td>
|
527
|
+
<pre class="code"><span class="info file"># File 'lib/resourcespace.rb', line 51</span>
|
528
|
+
|
529
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_configure'>configure</span>
|
530
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_configuration'>configuration</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Configuration.html#initialize-instance_method" title="ResourceSpace::Configuration#initialize (method)">new</a></span></span>
|
531
|
+
<span class='kw'>yield</span><span class='lparen'>(</span><span class='id identifier rubyid_configuration'>configuration</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
532
|
+
<span class='id identifier rubyid_configuration'>configuration</span>
|
533
|
+
<span class='kw'>end</span></pre>
|
534
|
+
</td>
|
535
|
+
</tr>
|
536
|
+
</table>
|
537
|
+
</div>
|
538
|
+
|
539
|
+
<div class="method_details ">
|
540
|
+
<h3 class="signature " id="from_response-class_method">
|
541
|
+
|
542
|
+
.<strong>from_response</strong>(status_code, message = nil, response_body = nil) ⇒ <tt><span class='object_link'><a href="ResourceSpace/Error.html" title="ResourceSpace::Error (class)">Error</a></span></tt>
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
</h3><div class="docstring">
|
549
|
+
<div class="discussion">
|
550
|
+
|
551
|
+
<p>Method to create appropriate error based on HTTP status code</p>
|
552
|
+
|
553
|
+
|
554
|
+
</div>
|
555
|
+
</div>
|
556
|
+
<div class="tags">
|
557
|
+
<p class="tag_title">Parameters:</p>
|
558
|
+
<ul class="param">
|
559
|
+
|
560
|
+
<li>
|
561
|
+
|
562
|
+
<span class='name'>status_code</span>
|
563
|
+
|
564
|
+
|
565
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
—
|
570
|
+
<div class='inline'>
|
571
|
+
<p>HTTP status code</p>
|
572
|
+
</div>
|
573
|
+
|
574
|
+
</li>
|
575
|
+
|
576
|
+
<li>
|
577
|
+
|
578
|
+
<span class='name'>message</span>
|
579
|
+
|
580
|
+
|
581
|
+
<span class='type'>(<tt>String</tt>)</span>
|
582
|
+
|
583
|
+
|
584
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
585
|
+
|
586
|
+
|
587
|
+
—
|
588
|
+
<div class='inline'>
|
589
|
+
<p>error message</p>
|
590
|
+
</div>
|
591
|
+
|
592
|
+
</li>
|
593
|
+
|
594
|
+
<li>
|
595
|
+
|
596
|
+
<span class='name'>response_body</span>
|
597
|
+
|
598
|
+
|
599
|
+
<span class='type'>(<tt>String</tt>)</span>
|
600
|
+
|
601
|
+
|
602
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
603
|
+
|
604
|
+
|
605
|
+
—
|
606
|
+
<div class='inline'>
|
607
|
+
<p>HTTP response body</p>
|
608
|
+
</div>
|
609
|
+
|
610
|
+
</li>
|
611
|
+
|
612
|
+
</ul>
|
613
|
+
|
614
|
+
<p class="tag_title">Returns:</p>
|
615
|
+
<ul class="return">
|
616
|
+
|
617
|
+
<li>
|
618
|
+
|
619
|
+
|
620
|
+
<span class='type'>(<tt><span class='object_link'><a href="ResourceSpace/Error.html" title="ResourceSpace::Error (class)">Error</a></span></tt>)</span>
|
621
|
+
|
622
|
+
|
623
|
+
|
624
|
+
—
|
625
|
+
<div class='inline'>
|
626
|
+
<p>appropriate error instance</p>
|
627
|
+
</div>
|
628
|
+
|
629
|
+
</li>
|
630
|
+
|
631
|
+
</ul>
|
632
|
+
|
633
|
+
</div><table class="source_code">
|
634
|
+
<tr>
|
635
|
+
<td>
|
636
|
+
<pre class="lines">
|
637
|
+
|
638
|
+
|
639
|
+
89
|
640
|
+
90
|
641
|
+
91
|
642
|
+
92
|
643
|
+
93
|
644
|
+
94
|
645
|
+
95
|
646
|
+
96
|
647
|
+
97
|
648
|
+
98
|
649
|
+
99
|
650
|
+
100
|
651
|
+
101
|
652
|
+
102
|
653
|
+
103
|
654
|
+
104
|
655
|
+
105
|
656
|
+
106
|
657
|
+
107
|
658
|
+
108
|
659
|
+
109
|
660
|
+
110</pre>
|
661
|
+
</td>
|
662
|
+
<td>
|
663
|
+
<pre class="code"><span class="info file"># File 'lib/resourcespace/errors.rb', line 89</span>
|
664
|
+
|
665
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_response_body'>response_body</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
666
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_status_code'>status_code</span>
|
667
|
+
<span class='kw'>when</span> <span class='int'>400</span>
|
668
|
+
<span class='const'><span class='object_link'><a href="ResourceSpace/ValidationError.html" title="ResourceSpace::ValidationError (class)">ValidationError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Error.html#initialize-instance_method" title="ResourceSpace::Error#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>status_code:</span> <span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='label'>response_body:</span> <span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
669
|
+
<span class='kw'>when</span> <span class='int'>401</span>
|
670
|
+
<span class='const'><span class='object_link'><a href="ResourceSpace/AuthenticationError.html" title="ResourceSpace::AuthenticationError (class)">AuthenticationError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Error.html#initialize-instance_method" title="ResourceSpace::Error#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>status_code:</span> <span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='label'>response_body:</span> <span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
671
|
+
<span class='kw'>when</span> <span class='int'>403</span>
|
672
|
+
<span class='const'><span class='object_link'><a href="ResourceSpace/AuthorizationError.html" title="ResourceSpace::AuthorizationError (class)">AuthorizationError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Error.html#initialize-instance_method" title="ResourceSpace::Error#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>status_code:</span> <span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='label'>response_body:</span> <span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
673
|
+
<span class='kw'>when</span> <span class='int'>404</span>
|
674
|
+
<span class='const'><span class='object_link'><a href="ResourceSpace/NotFoundError.html" title="ResourceSpace::NotFoundError (class)">NotFoundError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Error.html#initialize-instance_method" title="ResourceSpace::Error#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>status_code:</span> <span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='label'>response_body:</span> <span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
675
|
+
<span class='kw'>when</span> <span class='int'>409</span>
|
676
|
+
<span class='const'><span class='object_link'><a href="ResourceSpace/ConflictError.html" title="ResourceSpace::ConflictError (class)">ConflictError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Error.html#initialize-instance_method" title="ResourceSpace::Error#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>status_code:</span> <span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='label'>response_body:</span> <span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
677
|
+
<span class='kw'>when</span> <span class='int'>429</span>
|
678
|
+
<span class='const'><span class='object_link'><a href="ResourceSpace/RateLimitError.html" title="ResourceSpace::RateLimitError (class)">RateLimitError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Error.html#initialize-instance_method" title="ResourceSpace::Error#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>status_code:</span> <span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='label'>response_body:</span> <span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
679
|
+
<span class='kw'>when</span> <span class='int'>400</span><span class='op'>..</span><span class='int'>499</span>
|
680
|
+
<span class='const'><span class='object_link'><a href="ResourceSpace/ClientError.html" title="ResourceSpace::ClientError (class)">ClientError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Error.html#initialize-instance_method" title="ResourceSpace::Error#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>status_code:</span> <span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='label'>response_body:</span> <span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
681
|
+
<span class='kw'>when</span> <span class='int'>500</span><span class='op'>..</span><span class='int'>599</span>
|
682
|
+
<span class='const'><span class='object_link'><a href="ResourceSpace/ServerError.html" title="ResourceSpace::ServerError (class)">ServerError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Error.html#initialize-instance_method" title="ResourceSpace::Error#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>status_code:</span> <span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='label'>response_body:</span> <span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
683
|
+
<span class='kw'>else</span>
|
684
|
+
<span class='const'><span class='object_link'><a href="ResourceSpace/Error.html" title="ResourceSpace::Error (class)">Error</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Error.html#initialize-instance_method" title="ResourceSpace::Error#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>status_code:</span> <span class='id identifier rubyid_status_code'>status_code</span><span class='comma'>,</span> <span class='label'>response_body:</span> <span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
685
|
+
<span class='kw'>end</span>
|
686
|
+
<span class='kw'>end</span></pre>
|
687
|
+
</td>
|
688
|
+
</tr>
|
689
|
+
</table>
|
690
|
+
</div>
|
691
|
+
|
692
|
+
<div class="method_details ">
|
693
|
+
<h3 class="signature " id="reset_config!-class_method">
|
694
|
+
|
695
|
+
.<strong>reset_config!</strong> ⇒ <tt><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></tt>
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
|
701
|
+
</h3><div class="docstring">
|
702
|
+
<div class="discussion">
|
703
|
+
|
704
|
+
<p>Reset the configuration to defaults</p>
|
705
|
+
|
706
|
+
|
707
|
+
</div>
|
708
|
+
</div>
|
709
|
+
<div class="tags">
|
710
|
+
|
711
|
+
<p class="tag_title">Returns:</p>
|
712
|
+
<ul class="return">
|
713
|
+
|
714
|
+
<li>
|
715
|
+
|
716
|
+
|
717
|
+
<span class='type'>(<tt><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></tt>)</span>
|
718
|
+
|
719
|
+
|
720
|
+
|
721
|
+
—
|
722
|
+
<div class='inline'>
|
723
|
+
<p>a new configuration instance</p>
|
724
|
+
</div>
|
725
|
+
|
726
|
+
</li>
|
727
|
+
|
728
|
+
</ul>
|
729
|
+
|
730
|
+
</div><table class="source_code">
|
731
|
+
<tr>
|
732
|
+
<td>
|
733
|
+
<pre class="lines">
|
734
|
+
|
735
|
+
|
736
|
+
67
|
737
|
+
68
|
738
|
+
69</pre>
|
739
|
+
</td>
|
740
|
+
<td>
|
741
|
+
<pre class="code"><span class="info file"># File 'lib/resourcespace.rb', line 67</span>
|
742
|
+
|
743
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_reset_config!'>reset_config!</span>
|
744
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_configuration'>configuration</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ResourceSpace/Configuration.html" title="ResourceSpace::Configuration (class)">Configuration</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ResourceSpace/Configuration.html#initialize-instance_method" title="ResourceSpace::Configuration#initialize (method)">new</a></span></span>
|
745
|
+
<span class='kw'>end</span></pre>
|
746
|
+
</td>
|
747
|
+
</tr>
|
748
|
+
</table>
|
749
|
+
</div>
|
750
|
+
|
751
|
+
</div>
|
752
|
+
|
753
|
+
</div>
|
754
|
+
|
755
|
+
<div id="footer">
|
756
|
+
Generated on Sat May 24 15:41:23 2025 by
|
757
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
758
|
+
0.9.37 (ruby-3.4.4).
|
759
|
+
</div>
|
760
|
+
|
761
|
+
</div>
|
762
|
+
</body>
|
763
|
+
</html>
|