moxiworks_platform 0.13.15 → 0.13.16
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/.gitignore +3 -1
- data/Gemfile +2 -0
- data/lib/moxiworks_platform/action_log.rb +31 -2
- data/lib/moxiworks_platform/company.rb +0 -3
- data/lib/moxiworks_platform/contact.rb +5 -6
- data/lib/moxiworks_platform/listing.rb +11 -1
- data/lib/moxiworks_platform/version.rb +1 -1
- data/publish_docs.sh +7 -2
- metadata +2 -28
- data/MoxiworksPlatform/ActionLog.html +0 -1155
- data/MoxiworksPlatform/Agent.html +0 -3668
- data/MoxiworksPlatform/Brand.html +0 -2897
- data/MoxiworksPlatform/BuyerTransaction.html +0 -4703
- data/MoxiworksPlatform/Company.html +0 -678
- data/MoxiworksPlatform/Config.html +0 -323
- data/MoxiworksPlatform/Contact.html +0 -7540
- data/MoxiworksPlatform/Credentials.html +0 -1078
- data/MoxiworksPlatform/EmailCampaign.html +0 -1076
- data/MoxiworksPlatform/Event.html +0 -2987
- data/MoxiworksPlatform/Exception.html +0 -117
- data/MoxiworksPlatform/Exception/ArgumentError.html +0 -146
- data/MoxiworksPlatform/Exception/AuthorizationError.html +0 -134
- data/MoxiworksPlatform/Exception/PlatformError.html +0 -141
- data/MoxiworksPlatform/Exception/RemoteRequestFailure.html +0 -134
- data/MoxiworksPlatform/Gallery.html +0 -877
- data/MoxiworksPlatform/Group.html +0 -941
- data/MoxiworksPlatform/Listing.html +0 -6242
- data/MoxiworksPlatform/Office.html +0 -2144
- data/MoxiworksPlatform/PresentationLog.html +0 -1715
- data/MoxiworksPlatform/Resource.html +0 -1906
- data/MoxiworksPlatform/SellerTransaction.html +0 -4222
- data/MoxiworksPlatform/Session.html +0 -209
- data/MoxiworksPlatform/SoldListing.html +0 -5606
- data/MoxiworksPlatform/Task.html +0 -2351
- data/MoxiworksPlatform/Team.html +0 -2147
@@ -1,1906 +0,0 @@
|
|
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: MoxiworksPlatform::Resource
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.5
|
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 = "MoxiworksPlatform::Resource";
|
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"></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
|
-
<span class='title'><span class='object_link'><a href="../MoxiworksPlatform.html" title="MoxiworksPlatform (module)">MoxiworksPlatform</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">Resource</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
|
-
<iframe id="search_frame" src="../class_list.html"></iframe>
|
63
|
-
|
64
|
-
<div id="content"><h1>Class: MoxiworksPlatform::Resource
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
</h1>
|
69
|
-
<div class="box_info">
|
70
|
-
|
71
|
-
<dl>
|
72
|
-
<dt>Inherits:</dt>
|
73
|
-
<dd>
|
74
|
-
<span class="inheritName">Object</span>
|
75
|
-
|
76
|
-
<ul class="fullTree">
|
77
|
-
<li>Object</li>
|
78
|
-
|
79
|
-
<li class="next">MoxiworksPlatform::Resource</li>
|
80
|
-
|
81
|
-
</ul>
|
82
|
-
<a href="#" class="inheritanceTree">show all</a>
|
83
|
-
|
84
|
-
</dd>
|
85
|
-
</dl>
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
<dl>
|
98
|
-
<dt>Defined in:</dt>
|
99
|
-
<dd>lib/moxiworks_platform/resource.rb</dd>
|
100
|
-
</dl>
|
101
|
-
|
102
|
-
</div>
|
103
|
-
|
104
|
-
<h2>Overview</h2><div class="docstring">
|
105
|
-
<div class="discussion">
|
106
|
-
|
107
|
-
<p>provides underlying logic for connecting to Moxi Works Platform over HTTPS</p>
|
108
|
-
|
109
|
-
|
110
|
-
</div>
|
111
|
-
</div>
|
112
|
-
<div class="tags">
|
113
|
-
|
114
|
-
|
115
|
-
</div><div id="subclasses">
|
116
|
-
<h2>Direct Known Subclasses</h2>
|
117
|
-
<p class="children"><span class='object_link'><a href="ActionLog.html" title="MoxiworksPlatform::ActionLog (class)">ActionLog</a></span>, <span class='object_link'><a href="Agent.html" title="MoxiworksPlatform::Agent (class)">Agent</a></span>, <span class='object_link'><a href="Brand.html" title="MoxiworksPlatform::Brand (class)">Brand</a></span>, <span class='object_link'><a href="BuyerTransaction.html" title="MoxiworksPlatform::BuyerTransaction (class)">BuyerTransaction</a></span>, <span class='object_link'><a href="Company.html" title="MoxiworksPlatform::Company (class)">Company</a></span>, <span class='object_link'><a href="Contact.html" title="MoxiworksPlatform::Contact (class)">Contact</a></span>, <span class='object_link'><a href="EmailCampaign.html" title="MoxiworksPlatform::EmailCampaign (class)">EmailCampaign</a></span>, <span class='object_link'><a href="Event.html" title="MoxiworksPlatform::Event (class)">Event</a></span>, <span class='object_link'><a href="Gallery.html" title="MoxiworksPlatform::Gallery (class)">Gallery</a></span>, <span class='object_link'><a href="Group.html" title="MoxiworksPlatform::Group (class)">Group</a></span>, <span class='object_link'><a href="Listing.html" title="MoxiworksPlatform::Listing (class)">Listing</a></span>, <span class='object_link'><a href="Office.html" title="MoxiworksPlatform::Office (class)">Office</a></span>, <span class='object_link'><a href="PresentationLog.html" title="MoxiworksPlatform::PresentationLog (class)">PresentationLog</a></span>, <span class='object_link'><a href="SellerTransaction.html" title="MoxiworksPlatform::SellerTransaction (class)">SellerTransaction</a></span>, <span class='object_link'><a href="SoldListing.html" title="MoxiworksPlatform::SoldListing (class)">SoldListing</a></span>, <span class='object_link'><a href="Task.html" title="MoxiworksPlatform::Task (class)">Task</a></span>, <span class='object_link'><a href="Team.html" title="MoxiworksPlatform::Team (class)">Team</a></span></p>
|
118
|
-
</div>
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
124
|
-
<ul class="summary">
|
125
|
-
|
126
|
-
<li class="public ">
|
127
|
-
<span class="summary_signature">
|
128
|
-
|
129
|
-
<a href="#headers-instance_method" title="#headers (instance method)">#<strong>headers</strong> ⇒ Object </a>
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
</span>
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
<span class="summary_desc"><div class='inline'>
|
147
|
-
<p>Returns the value of attribute headers.</p>
|
148
|
-
</div></span>
|
149
|
-
|
150
|
-
</li>
|
151
|
-
|
152
|
-
|
153
|
-
</ul>
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
<h2>
|
160
|
-
Class Method Summary
|
161
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
162
|
-
</h2>
|
163
|
-
|
164
|
-
<ul class="summary">
|
165
|
-
|
166
|
-
<li class="public ">
|
167
|
-
<span class="summary_signature">
|
168
|
-
|
169
|
-
<a href="#accept_header-class_method" title="accept_header (class method)">.<strong>accept_header</strong> ⇒ String </a>
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
</span>
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
<span class="summary_desc"><div class='inline'>
|
184
|
-
<p>formatted Accept header content.</p>
|
185
|
-
</div></span>
|
186
|
-
|
187
|
-
</li>
|
188
|
-
|
189
|
-
|
190
|
-
<li class="public ">
|
191
|
-
<span class="summary_signature">
|
192
|
-
|
193
|
-
<a href="#attr_accessor-class_method" title="attr_accessor (class method)">.<strong>attr_accessor</strong>(*vars) ⇒ Object </a>
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
</span>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
<span class="summary_desc"><div class='inline'>
|
208
|
-
<p>keep a list of attr_accessors defined in this class.</p>
|
209
|
-
</div></span>
|
210
|
-
|
211
|
-
</li>
|
212
|
-
|
213
|
-
|
214
|
-
<li class="public ">
|
215
|
-
<span class="summary_signature">
|
216
|
-
|
217
|
-
<a href="#attributes-class_method" title="attributes (class method)">.<strong>attributes</strong> ⇒ Array </a>
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
</span>
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
<span class="summary_desc"><div class='inline'>
|
232
|
-
<p>all available accessors defined in this class.</p>
|
233
|
-
</div></span>
|
234
|
-
|
235
|
-
</li>
|
236
|
-
|
237
|
-
|
238
|
-
<li class="public ">
|
239
|
-
<span class="summary_signature">
|
240
|
-
|
241
|
-
<a href="#auth_header-class_method" title="auth_header (class method)">.<strong>auth_header</strong> ⇒ String </a>
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
</span>
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
<span class="summary_desc"><div class='inline'>
|
256
|
-
<p>formatted Authorization header content.</p>
|
257
|
-
</div></span>
|
258
|
-
|
259
|
-
</li>
|
260
|
-
|
261
|
-
|
262
|
-
<li class="public ">
|
263
|
-
<span class="summary_signature">
|
264
|
-
|
265
|
-
<a href="#check_for_error_in_response-class_method" title="check_for_error_in_response (class method)">.<strong>check_for_error_in_response</strong>(response) ⇒ Object </a>
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
</span>
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
280
|
-
|
281
|
-
</li>
|
282
|
-
|
283
|
-
|
284
|
-
<li class="public ">
|
285
|
-
<span class="summary_signature">
|
286
|
-
|
287
|
-
<a href="#content_type_header-class_method" title="content_type_header (class method)">.<strong>content_type_header</strong> ⇒ String </a>
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
</span>
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
<span class="summary_desc"><div class='inline'>
|
302
|
-
<p>formatted Content-Type header.</p>
|
303
|
-
</div></span>
|
304
|
-
|
305
|
-
</li>
|
306
|
-
|
307
|
-
|
308
|
-
<li class="public ">
|
309
|
-
<span class="summary_signature">
|
310
|
-
|
311
|
-
<a href="#headers-class_method" title="headers (class method)">.<strong>headers</strong> ⇒ Hash </a>
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
</span>
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
<span class="summary_desc"><div class='inline'>
|
326
|
-
<p>HTTP headers required to connect to Moxi Works Platform.</p>
|
327
|
-
</div></span>
|
328
|
-
|
329
|
-
</li>
|
330
|
-
|
331
|
-
|
332
|
-
<li class="public ">
|
333
|
-
<span class="summary_signature">
|
334
|
-
|
335
|
-
<a href="#send_request-class_method" title="send_request (class method)">.<strong>send_request</strong>(method, opts = {}, url = nil) ⇒ Object </a>
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
</span>
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
350
|
-
|
351
|
-
</li>
|
352
|
-
|
353
|
-
|
354
|
-
<li class="public ">
|
355
|
-
<span class="summary_signature">
|
356
|
-
|
357
|
-
<a href="#underscore-class_method" title="underscore (class method)">.<strong>underscore</strong>(attr) ⇒ Object </a>
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
</span>
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
372
|
-
|
373
|
-
</li>
|
374
|
-
|
375
|
-
|
376
|
-
<li class="public ">
|
377
|
-
<span class="summary_signature">
|
378
|
-
|
379
|
-
<a href="#underscore_array-class_method" title="underscore_array (class method)">.<strong>underscore_array</strong>(array) ⇒ Object </a>
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
</span>
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
394
|
-
|
395
|
-
</li>
|
396
|
-
|
397
|
-
|
398
|
-
<li class="public ">
|
399
|
-
<span class="summary_signature">
|
400
|
-
|
401
|
-
<a href="#underscore_attribute_names-class_method" title="underscore_attribute_names (class method)">.<strong>underscore_attribute_names</strong>(thing) ⇒ Object </a>
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
</span>
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
416
|
-
|
417
|
-
</li>
|
418
|
-
|
419
|
-
|
420
|
-
<li class="public ">
|
421
|
-
<span class="summary_signature">
|
422
|
-
|
423
|
-
<a href="#underscore_hash-class_method" title="underscore_hash (class method)">.<strong>underscore_hash</strong>(hash) ⇒ Object </a>
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
</span>
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
438
|
-
|
439
|
-
</li>
|
440
|
-
|
441
|
-
|
442
|
-
<li class="public ">
|
443
|
-
<span class="summary_signature">
|
444
|
-
|
445
|
-
<a href="#user_agent_header-class_method" title="user_agent_header (class method)">.<strong>user_agent_header</strong> ⇒ Object </a>
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
</span>
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
460
|
-
|
461
|
-
</li>
|
462
|
-
|
463
|
-
|
464
|
-
</ul>
|
465
|
-
|
466
|
-
<h2>
|
467
|
-
Instance Method Summary
|
468
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
469
|
-
</h2>
|
470
|
-
|
471
|
-
<ul class="summary">
|
472
|
-
|
473
|
-
<li class="public ">
|
474
|
-
<span class="summary_signature">
|
475
|
-
|
476
|
-
<a href="#attributes-instance_method" title="#attributes (instance method)">#<strong>attributes</strong> ⇒ Array </a>
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
</span>
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
<span class="summary_desc"><div class='inline'>
|
491
|
-
<p>all available accessors defined in this class.</p>
|
492
|
-
</div></span>
|
493
|
-
|
494
|
-
</li>
|
495
|
-
|
496
|
-
|
497
|
-
<li class="public ">
|
498
|
-
<span class="summary_signature">
|
499
|
-
|
500
|
-
<a href="#float_attrs-instance_method" title="#float_attrs (instance method)">#<strong>float_attrs</strong> ⇒ Object </a>
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
</span>
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
<span class="summary_desc"><div class='inline'>
|
515
|
-
<p>used by method_missing to ensure that a number is the type we expect it to
|
516
|
-
be this should be overridden if we have any float values we want to return
|
517
|
-
as floats.</p>
|
518
|
-
</div></span>
|
519
|
-
|
520
|
-
</li>
|
521
|
-
|
522
|
-
|
523
|
-
<li class="public ">
|
524
|
-
<span class="summary_signature">
|
525
|
-
|
526
|
-
<a href="#init_attrs_from_hash-instance_method" title="#init_attrs_from_hash (instance method)">#<strong>init_attrs_from_hash</strong>(hash = {}) ⇒ Object </a>
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
</span>
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
541
|
-
|
542
|
-
</li>
|
543
|
-
|
544
|
-
|
545
|
-
<li class="public ">
|
546
|
-
<span class="summary_signature">
|
547
|
-
|
548
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(hash = {}) ⇒ Resource </a>
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
</span>
|
553
|
-
|
554
|
-
|
555
|
-
<span class="note title constructor">constructor</span>
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
<span class="summary_desc"><div class='inline'>
|
565
|
-
<p>maps Hash values to Instance variables for mapping JSON object values to
|
566
|
-
our Class attributes.</p>
|
567
|
-
</div></span>
|
568
|
-
|
569
|
-
</li>
|
570
|
-
|
571
|
-
|
572
|
-
<li class="public ">
|
573
|
-
<span class="summary_signature">
|
574
|
-
|
575
|
-
<a href="#int_attrs-instance_method" title="#int_attrs (instance method)">#<strong>int_attrs</strong> ⇒ Object </a>
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
</span>
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
<span class="summary_desc"><div class='inline'>
|
590
|
-
<p>used by method_missing to ensure that a number is the type we expect it to
|
591
|
-
be this should be overridden if we have any int values we want to return as
|
592
|
-
ints.</p>
|
593
|
-
</div></span>
|
594
|
-
|
595
|
-
</li>
|
596
|
-
|
597
|
-
|
598
|
-
<li class="public ">
|
599
|
-
<span class="summary_signature">
|
600
|
-
|
601
|
-
<a href="#method_missing-instance_method" title="#method_missing (instance method)">#<strong>method_missing</strong>(meth, *args, &block) ⇒ Object </a>
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
</span>
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
616
|
-
|
617
|
-
</li>
|
618
|
-
|
619
|
-
|
620
|
-
<li class="public ">
|
621
|
-
<span class="summary_signature">
|
622
|
-
|
623
|
-
<a href="#numeric_attrs-instance_method" title="#numeric_attrs (instance method)">#<strong>numeric_attrs</strong> ⇒ Object </a>
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
</span>
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
<span class="summary_desc"><div class='inline'>
|
638
|
-
<p>used by method_missing to ensure that a number is the type we expect it to
|
639
|
-
be.</p>
|
640
|
-
</div></span>
|
641
|
-
|
642
|
-
</li>
|
643
|
-
|
644
|
-
|
645
|
-
<li class="public ">
|
646
|
-
<span class="summary_signature">
|
647
|
-
|
648
|
-
<a href="#numeric_value_for-instance_method" title="#numeric_value_for (instance method)">#<strong>numeric_value_for</strong>(attr_name, opts = {}) ⇒ Object </a>
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
</span>
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
663
|
-
|
664
|
-
</li>
|
665
|
-
|
666
|
-
|
667
|
-
<li class="public ">
|
668
|
-
<span class="summary_signature">
|
669
|
-
|
670
|
-
<a href="#to_hash-instance_method" title="#to_hash (instance method)">#<strong>to_hash</strong> ⇒ Hash </a>
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
</span>
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
<span class="summary_desc"><div class='inline'>
|
685
|
-
<p>convert this class into a Hash structure where attributes are Hash key
|
686
|
-
names and attribute values are Hash values.</p>
|
687
|
-
</div></span>
|
688
|
-
|
689
|
-
</li>
|
690
|
-
|
691
|
-
|
692
|
-
</ul>
|
693
|
-
|
694
|
-
|
695
|
-
<div id="constructor_details" class="method_details_list">
|
696
|
-
<h2>Constructor Details</h2>
|
697
|
-
|
698
|
-
<div class="method_details first">
|
699
|
-
<h3 class="signature first" id="initialize-instance_method">
|
700
|
-
|
701
|
-
#<strong>initialize</strong>(hash = {}) ⇒ <tt><span class='object_link'><a href="" title="MoxiworksPlatform::Resource (class)">Resource</a></span></tt>
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
</h3><div class="docstring">
|
708
|
-
<div class="discussion">
|
709
|
-
|
710
|
-
<p>maps Hash values to Instance variables for mapping JSON object values to
|
711
|
-
our Class attributes</p>
|
712
|
-
|
713
|
-
|
714
|
-
</div>
|
715
|
-
</div>
|
716
|
-
<div class="tags">
|
717
|
-
|
718
|
-
|
719
|
-
</div><table class="source_code">
|
720
|
-
<tr>
|
721
|
-
<td>
|
722
|
-
<pre class="lines">
|
723
|
-
|
724
|
-
|
725
|
-
164
|
726
|
-
165
|
727
|
-
166</pre>
|
728
|
-
</td>
|
729
|
-
<td>
|
730
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 164</span>
|
731
|
-
|
732
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
733
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_init_attrs_from_hash'>init_attrs_from_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
|
734
|
-
<span class='kw'>end</span></pre>
|
735
|
-
</td>
|
736
|
-
</tr>
|
737
|
-
</table>
|
738
|
-
</div>
|
739
|
-
|
740
|
-
</div>
|
741
|
-
<div id="method_missing_details" class="method_details_list">
|
742
|
-
<h2>Dynamic Method Handling</h2>
|
743
|
-
<p class="notice this">
|
744
|
-
This class handles dynamic methods through the <tt>method_missing</tt> method
|
745
|
-
|
746
|
-
</p>
|
747
|
-
|
748
|
-
<div class="method_details first">
|
749
|
-
<h3 class="signature first" id="method_missing-instance_method">
|
750
|
-
|
751
|
-
#<strong>method_missing</strong>(meth, *args, &block) ⇒ <tt>Object</tt>
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
</h3><table class="source_code">
|
758
|
-
<tr>
|
759
|
-
<td>
|
760
|
-
<pre class="lines">
|
761
|
-
|
762
|
-
|
763
|
-
193
|
764
|
-
194
|
765
|
-
195
|
766
|
-
196
|
767
|
-
197
|
768
|
-
198
|
769
|
-
199
|
770
|
-
200</pre>
|
771
|
-
</td>
|
772
|
-
<td>
|
773
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 193</span>
|
774
|
-
|
775
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
776
|
-
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_meth'>meth</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
777
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_numeric_attrs'>numeric_attrs</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_name'>name</span>
|
778
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_numeric_value_for'>numeric_value_for</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:integer</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_int_attrs'>int_attrs</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_name'>name</span>
|
779
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_numeric_value_for'>numeric_value_for</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:float</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_float_attrs'>float_attrs</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_name'>name</span>
|
780
|
-
<span class='kw'>end</span>
|
781
|
-
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
782
|
-
<span class='kw'>end</span></pre>
|
783
|
-
</td>
|
784
|
-
</tr>
|
785
|
-
</table>
|
786
|
-
</div>
|
787
|
-
|
788
|
-
</div>
|
789
|
-
|
790
|
-
<div id="instance_attr_details" class="attr_details">
|
791
|
-
<h2>Instance Attribute Details</h2>
|
792
|
-
|
793
|
-
|
794
|
-
<span id="headers=-instance_method"></span>
|
795
|
-
<div class="method_details first">
|
796
|
-
<h3 class="signature first" id="headers-instance_method">
|
797
|
-
|
798
|
-
#<strong>headers</strong> ⇒ <tt>Object</tt>
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
</h3><div class="docstring">
|
805
|
-
<div class="discussion">
|
806
|
-
|
807
|
-
<p>Returns the value of attribute headers</p>
|
808
|
-
|
809
|
-
|
810
|
-
</div>
|
811
|
-
</div>
|
812
|
-
<div class="tags">
|
813
|
-
|
814
|
-
|
815
|
-
</div><table class="source_code">
|
816
|
-
<tr>
|
817
|
-
<td>
|
818
|
-
<pre class="lines">
|
819
|
-
|
820
|
-
|
821
|
-
9
|
822
|
-
10
|
823
|
-
11</pre>
|
824
|
-
</td>
|
825
|
-
<td>
|
826
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 9</span>
|
827
|
-
|
828
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_headers'>headers</span>
|
829
|
-
<span class='ivar'>@headers</span>
|
830
|
-
<span class='kw'>end</span></pre>
|
831
|
-
</td>
|
832
|
-
</tr>
|
833
|
-
</table>
|
834
|
-
</div>
|
835
|
-
|
836
|
-
</div>
|
837
|
-
|
838
|
-
|
839
|
-
<div id="class_method_details" class="method_details_list">
|
840
|
-
<h2>Class Method Details</h2>
|
841
|
-
|
842
|
-
|
843
|
-
<div class="method_details first">
|
844
|
-
<h3 class="signature first" id="accept_header-class_method">
|
845
|
-
|
846
|
-
.<strong>accept_header</strong> ⇒ <tt>String</tt>
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
</h3><div class="docstring">
|
853
|
-
<div class="discussion">
|
854
|
-
|
855
|
-
<p>formatted Accept header content</p>
|
856
|
-
|
857
|
-
|
858
|
-
</div>
|
859
|
-
</div>
|
860
|
-
<div class="tags">
|
861
|
-
|
862
|
-
<p class="tag_title">Returns:</p>
|
863
|
-
<ul class="return">
|
864
|
-
|
865
|
-
<li>
|
866
|
-
|
867
|
-
|
868
|
-
<span class='type'>(<tt>String</tt>)</span>
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
—
|
873
|
-
<div class='inline'>
|
874
|
-
<p>Accept header content</p>
|
875
|
-
</div>
|
876
|
-
|
877
|
-
</li>
|
878
|
-
|
879
|
-
</ul>
|
880
|
-
|
881
|
-
</div><table class="source_code">
|
882
|
-
<tr>
|
883
|
-
<td>
|
884
|
-
<pre class="lines">
|
885
|
-
|
886
|
-
|
887
|
-
59
|
888
|
-
60
|
889
|
-
61</pre>
|
890
|
-
</td>
|
891
|
-
<td>
|
892
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 59</span>
|
893
|
-
|
894
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_accept_header'>accept_header</span>
|
895
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>application/vnd.moxi-platform+json;version=1</span><span class='tstring_end'>'</span></span>
|
896
|
-
<span class='kw'>end</span></pre>
|
897
|
-
</td>
|
898
|
-
</tr>
|
899
|
-
</table>
|
900
|
-
</div>
|
901
|
-
|
902
|
-
<div class="method_details ">
|
903
|
-
<h3 class="signature " id="attr_accessor-class_method">
|
904
|
-
|
905
|
-
.<strong>attr_accessor</strong>(*vars) ⇒ <tt>Object</tt>
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
</h3><div class="docstring">
|
912
|
-
<div class="discussion">
|
913
|
-
|
914
|
-
<p>keep a list of attr_accessors defined in this class</p>
|
915
|
-
|
916
|
-
<p>used to convert Resource child object into parameters required for saving
|
917
|
-
in Moxi Works Platform</p>
|
918
|
-
|
919
|
-
|
920
|
-
</div>
|
921
|
-
</div>
|
922
|
-
<div class="tags">
|
923
|
-
|
924
|
-
|
925
|
-
</div><table class="source_code">
|
926
|
-
<tr>
|
927
|
-
<td>
|
928
|
-
<pre class="lines">
|
929
|
-
|
930
|
-
|
931
|
-
18
|
932
|
-
19
|
933
|
-
20
|
934
|
-
21
|
935
|
-
22</pre>
|
936
|
-
</td>
|
937
|
-
<td>
|
938
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 18</span>
|
939
|
-
|
940
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_accessor'>attr_accessor</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_vars'>vars</span><span class='rparen'>)</span>
|
941
|
-
<span class='ivar'>@attributes</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
942
|
-
<span class='ivar'>@attributes</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_vars'>vars</span>
|
943
|
-
<span class='kw'>super</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_vars'>vars</span><span class='rparen'>)</span>
|
944
|
-
<span class='kw'>end</span></pre>
|
945
|
-
</td>
|
946
|
-
</tr>
|
947
|
-
</table>
|
948
|
-
</div>
|
949
|
-
|
950
|
-
<div class="method_details ">
|
951
|
-
<h3 class="signature " id="attributes-class_method">
|
952
|
-
|
953
|
-
.<strong>attributes</strong> ⇒ <tt>Array</tt>
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
</h3><div class="docstring">
|
960
|
-
<div class="discussion">
|
961
|
-
|
962
|
-
<p>all available accessors defined in this class</p>
|
963
|
-
|
964
|
-
|
965
|
-
</div>
|
966
|
-
</div>
|
967
|
-
<div class="tags">
|
968
|
-
|
969
|
-
<p class="tag_title">Returns:</p>
|
970
|
-
<ul class="return">
|
971
|
-
|
972
|
-
<li>
|
973
|
-
|
974
|
-
|
975
|
-
<span class='type'>(<tt>Array</tt>)</span>
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
—
|
980
|
-
<div class='inline'><dl class="rdoc-list label-list"><dt>String
|
981
|
-
<dd>
|
982
|
-
<p>all defined accessors of this class</p>
|
983
|
-
</dd></dl>
|
984
|
-
</div>
|
985
|
-
|
986
|
-
</li>
|
987
|
-
|
988
|
-
</ul>
|
989
|
-
|
990
|
-
</div><table class="source_code">
|
991
|
-
<tr>
|
992
|
-
<td>
|
993
|
-
<pre class="lines">
|
994
|
-
|
995
|
-
|
996
|
-
27
|
997
|
-
28
|
998
|
-
29</pre>
|
999
|
-
</td>
|
1000
|
-
<td>
|
1001
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 27</span>
|
1002
|
-
|
1003
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span>
|
1004
|
-
<span class='ivar'>@attributes</span>
|
1005
|
-
<span class='kw'>end</span></pre>
|
1006
|
-
</td>
|
1007
|
-
</tr>
|
1008
|
-
</table>
|
1009
|
-
</div>
|
1010
|
-
|
1011
|
-
<div class="method_details ">
|
1012
|
-
<h3 class="signature " id="auth_header-class_method">
|
1013
|
-
|
1014
|
-
.<strong>auth_header</strong> ⇒ <tt>String</tt>
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
</h3><div class="docstring">
|
1021
|
-
<div class="discussion">
|
1022
|
-
|
1023
|
-
<p>formatted Authorization header content</p>
|
1024
|
-
|
1025
|
-
|
1026
|
-
</div>
|
1027
|
-
</div>
|
1028
|
-
<div class="tags">
|
1029
|
-
|
1030
|
-
<p class="tag_title">Returns:</p>
|
1031
|
-
<ul class="return">
|
1032
|
-
|
1033
|
-
<li>
|
1034
|
-
|
1035
|
-
|
1036
|
-
<span class='type'>(<tt>String</tt>)</span>
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
—
|
1041
|
-
<div class='inline'>
|
1042
|
-
<p>Authorization header content</p>
|
1043
|
-
</div>
|
1044
|
-
|
1045
|
-
</li>
|
1046
|
-
|
1047
|
-
</ul>
|
1048
|
-
<p class="tag_title">Raises:</p>
|
1049
|
-
<ul class="raise">
|
1050
|
-
|
1051
|
-
<li>
|
1052
|
-
|
1053
|
-
|
1054
|
-
<span class='type'>(<tt><span class='object_link'><a href="Exception/AuthorizationError.html" title="MoxiworksPlatform::Exception::AuthorizationError (class)">MoxiworksPlatform::Exception::AuthorizationError</a></span></tt>)</span>
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
</li>
|
1059
|
-
|
1060
|
-
</ul>
|
1061
|
-
|
1062
|
-
</div><table class="source_code">
|
1063
|
-
<tr>
|
1064
|
-
<td>
|
1065
|
-
<pre class="lines">
|
1066
|
-
|
1067
|
-
|
1068
|
-
47
|
1069
|
-
48
|
1070
|
-
49
|
1071
|
-
50
|
1072
|
-
51
|
1073
|
-
52
|
1074
|
-
53
|
1075
|
-
54</pre>
|
1076
|
-
</td>
|
1077
|
-
<td>
|
1078
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 47</span>
|
1079
|
-
|
1080
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_auth_header'>auth_header</span>
|
1081
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>MoxiworksPlatform</span><span class='op'>::</span><span class='const'>Exception</span><span class='op'>::</span><span class='const'>AuthorizationError</span><span class='comma'>,</span>
|
1082
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>MoxiworksPlatform::Credentials must be set before using</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span>
|
1083
|
-
<span class='const'>MoxiworksPlatform</span><span class='op'>::</span><span class='const'>Credentials</span><span class='period'>.</span><span class='id identifier rubyid_set?'>set?</span>
|
1084
|
-
<span class='id identifier rubyid_identifier'>identifier</span> <span class='op'>=</span> <span class='const'>MoxiworksPlatform</span><span class='op'>::</span><span class='const'>Credentials</span><span class='period'>.</span><span class='id identifier rubyid_platform_identifier'>platform_identifier</span>
|
1085
|
-
<span class='id identifier rubyid_secret'>secret</span> <span class='op'>=</span> <span class='const'>MoxiworksPlatform</span><span class='op'>::</span><span class='const'>Credentials</span><span class='period'>.</span><span class='id identifier rubyid_platform_secret'>platform_secret</span>
|
1086
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Basic </span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='const'>Base64</span><span class='period'>.</span><span class='id identifier rubyid_encode64'>encode64</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_identifier'>identifier</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_secret'>secret</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\n</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1087
|
-
<span class='kw'>end</span></pre>
|
1088
|
-
</td>
|
1089
|
-
</tr>
|
1090
|
-
</table>
|
1091
|
-
</div>
|
1092
|
-
|
1093
|
-
<div class="method_details ">
|
1094
|
-
<h3 class="signature " id="check_for_error_in_response-class_method">
|
1095
|
-
|
1096
|
-
.<strong>check_for_error_in_response</strong>(response) ⇒ <tt>Object</tt>
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
</h3><div class="docstring">
|
1103
|
-
<div class="discussion">
|
1104
|
-
|
1105
|
-
|
1106
|
-
</div>
|
1107
|
-
</div>
|
1108
|
-
<div class="tags">
|
1109
|
-
|
1110
|
-
<p class="tag_title">Raises:</p>
|
1111
|
-
<ul class="raise">
|
1112
|
-
|
1113
|
-
<li>
|
1114
|
-
|
1115
|
-
|
1116
|
-
<span class='type'>(<tt><span class='object_link'><a href="Exception/RemoteRequestFailure.html" title="MoxiworksPlatform::Exception::RemoteRequestFailure (class)">MoxiworksPlatform::Exception::RemoteRequestFailure</a></span></tt>)</span>
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
</li>
|
1121
|
-
|
1122
|
-
</ul>
|
1123
|
-
|
1124
|
-
</div><table class="source_code">
|
1125
|
-
<tr>
|
1126
|
-
<td>
|
1127
|
-
<pre class="lines">
|
1128
|
-
|
1129
|
-
|
1130
|
-
74
|
1131
|
-
75
|
1132
|
-
76
|
1133
|
-
77
|
1134
|
-
78
|
1135
|
-
79
|
1136
|
-
80
|
1137
|
-
81
|
1138
|
-
82
|
1139
|
-
83
|
1140
|
-
84
|
1141
|
-
85
|
1142
|
-
86
|
1143
|
-
87</pre>
|
1144
|
-
</td>
|
1145
|
-
<td>
|
1146
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 74</span>
|
1147
|
-
|
1148
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_check_for_error_in_response'>check_for_error_in_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
1149
|
-
<span class='kw'>begin</span>
|
1150
|
-
<span class='id identifier rubyid_json'>json</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
1151
|
-
<span class='const'>MoxiworksPlatform</span><span class='op'>::</span><span class='const'>Session</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_cookie'>cookie</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'>:set_cookie</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
|
1152
|
-
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
|
1153
|
-
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
1154
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>MoxiworksPlatform</span><span class='op'>::</span><span class='const'>Exception</span><span class='op'>::</span><span class='const'>RemoteRequestFailure</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unable to parse remote response </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n response:\n </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_response'>response</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1155
|
-
<span class='kw'>end</span>
|
1156
|
-
<span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unable to perform remote action on Moxi Works platform\n</span><span class='tstring_end'>"</span></span>
|
1157
|
-
<span class='id identifier rubyid_message'>message</span> <span class='op'><<</span> <span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>messages</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>,</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>messages</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1158
|
-
|
1159
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>MoxiworksPlatform</span><span class='op'>::</span><span class='const'>Exception</span><span class='op'>::</span><span class='const'>RemoteRequestFailure</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span> <span class='kw'>if</span>
|
1160
|
-
<span class='kw'>not</span> <span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>status</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>and</span> <span class='lparen'>(</span><span class='qwords_beg'>%w(</span><span class='tstring_content'>error</span><span class='words_sep'> </span><span class='tstring_content'>fail</span><span class='words_sep'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>status</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1161
|
-
<span class='kw'>end</span></pre>
|
1162
|
-
</td>
|
1163
|
-
</tr>
|
1164
|
-
</table>
|
1165
|
-
</div>
|
1166
|
-
|
1167
|
-
<div class="method_details ">
|
1168
|
-
<h3 class="signature " id="content_type_header-class_method">
|
1169
|
-
|
1170
|
-
.<strong>content_type_header</strong> ⇒ <tt>String</tt>
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
</h3><div class="docstring">
|
1177
|
-
<div class="discussion">
|
1178
|
-
|
1179
|
-
<p>formatted Content-Type header</p>
|
1180
|
-
|
1181
|
-
|
1182
|
-
</div>
|
1183
|
-
</div>
|
1184
|
-
<div class="tags">
|
1185
|
-
|
1186
|
-
<p class="tag_title">Returns:</p>
|
1187
|
-
<ul class="return">
|
1188
|
-
|
1189
|
-
<li>
|
1190
|
-
|
1191
|
-
|
1192
|
-
<span class='type'>(<tt>String</tt>)</span>
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
—
|
1197
|
-
<div class='inline'>
|
1198
|
-
<p>Content-Type header content</p>
|
1199
|
-
</div>
|
1200
|
-
|
1201
|
-
</li>
|
1202
|
-
|
1203
|
-
</ul>
|
1204
|
-
|
1205
|
-
</div><table class="source_code">
|
1206
|
-
<tr>
|
1207
|
-
<td>
|
1208
|
-
<pre class="lines">
|
1209
|
-
|
1210
|
-
|
1211
|
-
66
|
1212
|
-
67
|
1213
|
-
68</pre>
|
1214
|
-
</td>
|
1215
|
-
<td>
|
1216
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 66</span>
|
1217
|
-
|
1218
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_content_type_header'>content_type_header</span>
|
1219
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>application/x-www-form-urlencoded</span><span class='tstring_end'>'</span></span>
|
1220
|
-
<span class='kw'>end</span></pre>
|
1221
|
-
</td>
|
1222
|
-
</tr>
|
1223
|
-
</table>
|
1224
|
-
</div>
|
1225
|
-
|
1226
|
-
<div class="method_details ">
|
1227
|
-
<h3 class="signature " id="headers-class_method">
|
1228
|
-
|
1229
|
-
.<strong>headers</strong> ⇒ <tt>Hash</tt>
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
</h3><div class="docstring">
|
1236
|
-
<div class="discussion">
|
1237
|
-
|
1238
|
-
<p>HTTP headers required to connect to Moxi Works Platform</p>
|
1239
|
-
|
1240
|
-
|
1241
|
-
</div>
|
1242
|
-
</div>
|
1243
|
-
<div class="tags">
|
1244
|
-
|
1245
|
-
<p class="tag_title">Returns:</p>
|
1246
|
-
<ul class="return">
|
1247
|
-
|
1248
|
-
<li>
|
1249
|
-
|
1250
|
-
|
1251
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
—
|
1256
|
-
<div class='inline'>
|
1257
|
-
<p>formatted headers suitable for a RestClient connection</p>
|
1258
|
-
</div>
|
1259
|
-
|
1260
|
-
</li>
|
1261
|
-
|
1262
|
-
</ul>
|
1263
|
-
|
1264
|
-
</div><table class="source_code">
|
1265
|
-
<tr>
|
1266
|
-
<td>
|
1267
|
-
<pre class="lines">
|
1268
|
-
|
1269
|
-
|
1270
|
-
34
|
1271
|
-
35
|
1272
|
-
36
|
1273
|
-
37
|
1274
|
-
38
|
1275
|
-
39
|
1276
|
-
40
|
1277
|
-
41
|
1278
|
-
42</pre>
|
1279
|
-
</td>
|
1280
|
-
<td>
|
1281
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 34</span>
|
1282
|
-
|
1283
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span>
|
1284
|
-
<span class='lbrace'>{</span>
|
1285
|
-
<span class='label'>Authorization:</span> <span class='id identifier rubyid_auth_header'>auth_header</span><span class='comma'>,</span>
|
1286
|
-
<span class='label'>Accept:</span> <span class='id identifier rubyid_accept_header'>accept_header</span><span class='comma'>,</span>
|
1287
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_content_type_header'>content_type_header</span><span class='comma'>,</span>
|
1288
|
-
<span class='label'>Cookie:</span> <span class='const'>Session</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_cookie'>cookie</span><span class='comma'>,</span>
|
1289
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>X-Moxi-Library-User-Agent</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_user_agent_header'>user_agent_header</span>
|
1290
|
-
<span class='rbrace'>}</span>
|
1291
|
-
<span class='kw'>end</span></pre>
|
1292
|
-
</td>
|
1293
|
-
</tr>
|
1294
|
-
</table>
|
1295
|
-
</div>
|
1296
|
-
|
1297
|
-
<div class="method_details ">
|
1298
|
-
<h3 class="signature " id="send_request-class_method">
|
1299
|
-
|
1300
|
-
.<strong>send_request</strong>(method, opts = {}, url = nil) ⇒ <tt>Object</tt>
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
</h3><table class="source_code">
|
1307
|
-
<tr>
|
1308
|
-
<td>
|
1309
|
-
<pre class="lines">
|
1310
|
-
|
1311
|
-
|
1312
|
-
89
|
1313
|
-
90
|
1314
|
-
91
|
1315
|
-
92
|
1316
|
-
93
|
1317
|
-
94
|
1318
|
-
95
|
1319
|
-
96
|
1320
|
-
97
|
1321
|
-
98
|
1322
|
-
99
|
1323
|
-
100
|
1324
|
-
101</pre>
|
1325
|
-
</td>
|
1326
|
-
<td>
|
1327
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 89</span>
|
1328
|
-
|
1329
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send_request'>send_request</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_url'>url</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
1330
|
-
<span class='const'>RestClient</span><span class='op'>::</span><span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span>
|
1331
|
-
<span class='label'>url:</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span>
|
1332
|
-
<span class='label'>payload:</span> <span class='id identifier rubyid_opts'>opts</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_response'>response</span><span class='op'>|</span>
|
1333
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_response'>response</span> <span class='kw'>if</span> <span class='const'>MoxiworksPlatform</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span>
|
1334
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_check_for_error_in_response'>check_for_error_in_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
1335
|
-
<span class='id identifier rubyid_json'>json</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
1336
|
-
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>status</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>and</span> <span class='id identifier rubyid_json'>json</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>status</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>fail</span><span class='tstring_end'>'</span></span>
|
1337
|
-
<span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
1338
|
-
<span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span> <span class='kw'>unless</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1339
|
-
<span class='id identifier rubyid_r'>r</span>
|
1340
|
-
<span class='kw'>end</span>
|
1341
|
-
<span class='kw'>end</span></pre>
|
1342
|
-
</td>
|
1343
|
-
</tr>
|
1344
|
-
</table>
|
1345
|
-
</div>
|
1346
|
-
|
1347
|
-
<div class="method_details ">
|
1348
|
-
<h3 class="signature " id="underscore-class_method">
|
1349
|
-
|
1350
|
-
.<strong>underscore</strong>(attr) ⇒ <tt>Object</tt>
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
</h3><table class="source_code">
|
1357
|
-
<tr>
|
1358
|
-
<td>
|
1359
|
-
<pre class="lines">
|
1360
|
-
|
1361
|
-
|
1362
|
-
152
|
1363
|
-
153
|
1364
|
-
154
|
1365
|
-
155
|
1366
|
-
156
|
1367
|
-
157
|
1368
|
-
158</pre>
|
1369
|
-
</td>
|
1370
|
-
<td>
|
1371
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 152</span>
|
1372
|
-
|
1373
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span>
|
1374
|
-
<span class='id identifier rubyid_attr'>attr</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>::</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span>
|
1375
|
-
<span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>([A-Z]+)([A-Z][a-z])</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>\1_\2</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span>
|
1376
|
-
<span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>([a-z\d])([A-Z])</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>\1_\2</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span>
|
1377
|
-
<span class='id identifier rubyid_tr'>tr</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span>
|
1378
|
-
<span class='id identifier rubyid_downcase'>downcase</span>
|
1379
|
-
<span class='kw'>end</span></pre>
|
1380
|
-
</td>
|
1381
|
-
</tr>
|
1382
|
-
</table>
|
1383
|
-
</div>
|
1384
|
-
|
1385
|
-
<div class="method_details ">
|
1386
|
-
<h3 class="signature " id="underscore_array-class_method">
|
1387
|
-
|
1388
|
-
.<strong>underscore_array</strong>(array) ⇒ <tt>Object</tt>
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
</h3><table class="source_code">
|
1395
|
-
<tr>
|
1396
|
-
<td>
|
1397
|
-
<pre class="lines">
|
1398
|
-
|
1399
|
-
|
1400
|
-
135
|
1401
|
-
136
|
1402
|
-
137
|
1403
|
-
138
|
1404
|
-
139
|
1405
|
-
140
|
1406
|
-
141</pre>
|
1407
|
-
</td>
|
1408
|
-
<td>
|
1409
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 135</span>
|
1410
|
-
|
1411
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_underscore_array'>underscore_array</span><span class='lparen'>(</span><span class='id identifier rubyid_array'>array</span><span class='rparen'>)</span>
|
1412
|
-
<span class='id identifier rubyid_new_array'>new_array</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1413
|
-
<span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_member'>member</span><span class='op'>|</span>
|
1414
|
-
<span class='id identifier rubyid_new_array'>new_array</span> <span class='op'><<</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_underscore_attribute_names'>underscore_attribute_names</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
|
1415
|
-
<span class='kw'>end</span>
|
1416
|
-
<span class='id identifier rubyid_new_array'>new_array</span>
|
1417
|
-
<span class='kw'>end</span></pre>
|
1418
|
-
</td>
|
1419
|
-
</tr>
|
1420
|
-
</table>
|
1421
|
-
</div>
|
1422
|
-
|
1423
|
-
<div class="method_details ">
|
1424
|
-
<h3 class="signature " id="underscore_attribute_names-class_method">
|
1425
|
-
|
1426
|
-
.<strong>underscore_attribute_names</strong>(thing) ⇒ <tt>Object</tt>
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
</h3><table class="source_code">
|
1433
|
-
<tr>
|
1434
|
-
<td>
|
1435
|
-
<pre class="lines">
|
1436
|
-
|
1437
|
-
|
1438
|
-
123
|
1439
|
-
124
|
1440
|
-
125
|
1441
|
-
126
|
1442
|
-
127
|
1443
|
-
128
|
1444
|
-
129
|
1445
|
-
130
|
1446
|
-
131
|
1447
|
-
132
|
1448
|
-
133</pre>
|
1449
|
-
</td>
|
1450
|
-
<td>
|
1451
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 123</span>
|
1452
|
-
|
1453
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_underscore_attribute_names'>underscore_attribute_names</span><span class='lparen'>(</span><span class='id identifier rubyid_thing'>thing</span><span class='rparen'>)</span>
|
1454
|
-
<span class='kw'>case</span> <span class='id identifier rubyid_thing'>thing</span>
|
1455
|
-
<span class='kw'>when</span> <span class='const'>Array</span>
|
1456
|
-
<span class='id identifier rubyid_new_thing'>new_thing</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_underscore_array'>underscore_array</span><span class='lparen'>(</span><span class='id identifier rubyid_thing'>thing</span><span class='rparen'>)</span>
|
1457
|
-
<span class='kw'>when</span> <span class='const'>Hash</span>
|
1458
|
-
<span class='id identifier rubyid_new_thing'>new_thing</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_underscore_hash'>underscore_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_thing'>thing</span><span class='rparen'>)</span>
|
1459
|
-
<span class='kw'>else</span>
|
1460
|
-
<span class='id identifier rubyid_new_thing'>new_thing</span> <span class='op'>=</span> <span class='id identifier rubyid_thing'>thing</span>
|
1461
|
-
<span class='kw'>end</span>
|
1462
|
-
<span class='id identifier rubyid_new_thing'>new_thing</span>
|
1463
|
-
<span class='kw'>end</span></pre>
|
1464
|
-
</td>
|
1465
|
-
</tr>
|
1466
|
-
</table>
|
1467
|
-
</div>
|
1468
|
-
|
1469
|
-
<div class="method_details ">
|
1470
|
-
<h3 class="signature " id="underscore_hash-class_method">
|
1471
|
-
|
1472
|
-
.<strong>underscore_hash</strong>(hash) ⇒ <tt>Object</tt>
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
</h3><table class="source_code">
|
1479
|
-
<tr>
|
1480
|
-
<td>
|
1481
|
-
<pre class="lines">
|
1482
|
-
|
1483
|
-
|
1484
|
-
143
|
1485
|
-
144
|
1486
|
-
145
|
1487
|
-
146
|
1488
|
-
147
|
1489
|
-
148
|
1490
|
-
149
|
1491
|
-
150</pre>
|
1492
|
-
</td>
|
1493
|
-
<td>
|
1494
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 143</span>
|
1495
|
-
|
1496
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_underscore_hash'>underscore_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
|
1497
|
-
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span>
|
1498
|
-
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_underscore_attribute_names'>underscore_attribute_names</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
1499
|
-
<span class='id identifier rubyid_underscored'>underscored</span> <span class='op'>=</span> <span class='const'>Resource</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
1500
|
-
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_underscored'>underscored</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
1501
|
-
<span class='kw'>end</span>
|
1502
|
-
<span class='id identifier rubyid_hash'>hash</span>
|
1503
|
-
<span class='kw'>end</span></pre>
|
1504
|
-
</td>
|
1505
|
-
</tr>
|
1506
|
-
</table>
|
1507
|
-
</div>
|
1508
|
-
|
1509
|
-
<div class="method_details ">
|
1510
|
-
<h3 class="signature " id="user_agent_header-class_method">
|
1511
|
-
|
1512
|
-
.<strong>user_agent_header</strong> ⇒ <tt>Object</tt>
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
</h3><table class="source_code">
|
1519
|
-
<tr>
|
1520
|
-
<td>
|
1521
|
-
<pre class="lines">
|
1522
|
-
|
1523
|
-
|
1524
|
-
70
|
1525
|
-
71
|
1526
|
-
72</pre>
|
1527
|
-
</td>
|
1528
|
-
<td>
|
1529
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 70</span>
|
1530
|
-
|
1531
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_user_agent_header'>user_agent_header</span>
|
1532
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>moxiworks_platform ruby client</span><span class='tstring_end'>'</span></span>
|
1533
|
-
<span class='kw'>end</span></pre>
|
1534
|
-
</td>
|
1535
|
-
</tr>
|
1536
|
-
</table>
|
1537
|
-
</div>
|
1538
|
-
|
1539
|
-
</div>
|
1540
|
-
|
1541
|
-
<div id="instance_method_details" class="method_details_list">
|
1542
|
-
<h2>Instance Method Details</h2>
|
1543
|
-
|
1544
|
-
|
1545
|
-
<div class="method_details first">
|
1546
|
-
<h3 class="signature first" id="attributes-instance_method">
|
1547
|
-
|
1548
|
-
#<strong>attributes</strong> ⇒ <tt>Array</tt>
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
</h3><div class="docstring">
|
1555
|
-
<div class="discussion">
|
1556
|
-
|
1557
|
-
<p>all available accessors defined in this class</p>
|
1558
|
-
|
1559
|
-
|
1560
|
-
</div>
|
1561
|
-
</div>
|
1562
|
-
<div class="tags">
|
1563
|
-
|
1564
|
-
<p class="tag_title">Returns:</p>
|
1565
|
-
<ul class="return">
|
1566
|
-
|
1567
|
-
<li>
|
1568
|
-
|
1569
|
-
|
1570
|
-
<span class='type'>(<tt>Array</tt>)</span>
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
—
|
1575
|
-
<div class='inline'><dl class="rdoc-list label-list"><dt>String
|
1576
|
-
<dd>
|
1577
|
-
<p>all defined accessors of this class</p>
|
1578
|
-
</dd></dl>
|
1579
|
-
</div>
|
1580
|
-
|
1581
|
-
</li>
|
1582
|
-
|
1583
|
-
</ul>
|
1584
|
-
|
1585
|
-
</div><table class="source_code">
|
1586
|
-
<tr>
|
1587
|
-
<td>
|
1588
|
-
<pre class="lines">
|
1589
|
-
|
1590
|
-
|
1591
|
-
171
|
1592
|
-
172
|
1593
|
-
173</pre>
|
1594
|
-
</td>
|
1595
|
-
<td>
|
1596
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 171</span>
|
1597
|
-
|
1598
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span>
|
1599
|
-
<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_attributes'>attributes</span> <span class='op'>+</span> <span class='id identifier rubyid_numeric_attrs'>numeric_attrs</span>
|
1600
|
-
<span class='kw'>end</span></pre>
|
1601
|
-
</td>
|
1602
|
-
</tr>
|
1603
|
-
</table>
|
1604
|
-
</div>
|
1605
|
-
|
1606
|
-
<div class="method_details ">
|
1607
|
-
<h3 class="signature " id="float_attrs-instance_method">
|
1608
|
-
|
1609
|
-
#<strong>float_attrs</strong> ⇒ <tt>Object</tt>
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
</h3><div class="docstring">
|
1616
|
-
<div class="discussion">
|
1617
|
-
|
1618
|
-
<p>used by method_missing to ensure that a number is the type we expect it to
|
1619
|
-
be this should be overridden if we have any float values we want to return
|
1620
|
-
as floats</p>
|
1621
|
-
|
1622
|
-
|
1623
|
-
</div>
|
1624
|
-
</div>
|
1625
|
-
<div class="tags">
|
1626
|
-
|
1627
|
-
|
1628
|
-
</div><table class="source_code">
|
1629
|
-
<tr>
|
1630
|
-
<td>
|
1631
|
-
<pre class="lines">
|
1632
|
-
|
1633
|
-
|
1634
|
-
177
|
1635
|
-
178
|
1636
|
-
179</pre>
|
1637
|
-
</td>
|
1638
|
-
<td>
|
1639
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 177</span>
|
1640
|
-
|
1641
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_float_attrs'>float_attrs</span>
|
1642
|
-
<span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1643
|
-
<span class='kw'>end</span></pre>
|
1644
|
-
</td>
|
1645
|
-
</tr>
|
1646
|
-
</table>
|
1647
|
-
</div>
|
1648
|
-
|
1649
|
-
<div class="method_details ">
|
1650
|
-
<h3 class="signature " id="init_attrs_from_hash-instance_method">
|
1651
|
-
|
1652
|
-
#<strong>init_attrs_from_hash</strong>(hash = {}) ⇒ <tt>Object</tt>
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
</h3><table class="source_code">
|
1659
|
-
<tr>
|
1660
|
-
<td>
|
1661
|
-
<pre class="lines">
|
1662
|
-
|
1663
|
-
|
1664
|
-
187
|
1665
|
-
188
|
1666
|
-
189
|
1667
|
-
190
|
1668
|
-
191</pre>
|
1669
|
-
</td>
|
1670
|
-
<td>
|
1671
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 187</span>
|
1672
|
-
|
1673
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_init_attrs_from_hash'>init_attrs_from_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1674
|
-
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span><span class='id identifier rubyid_val'>val</span><span class='op'>|</span>
|
1675
|
-
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_val'>val</span><span class='rparen'>)</span>
|
1676
|
-
<span class='kw'>end</span>
|
1677
|
-
<span class='kw'>end</span></pre>
|
1678
|
-
</td>
|
1679
|
-
</tr>
|
1680
|
-
</table>
|
1681
|
-
</div>
|
1682
|
-
|
1683
|
-
<div class="method_details ">
|
1684
|
-
<h3 class="signature " id="int_attrs-instance_method">
|
1685
|
-
|
1686
|
-
#<strong>int_attrs</strong> ⇒ <tt>Object</tt>
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
</h3><div class="docstring">
|
1693
|
-
<div class="discussion">
|
1694
|
-
|
1695
|
-
<p>used by method_missing to ensure that a number is the type we expect it to
|
1696
|
-
be this should be overridden if we have any int values we want to return as
|
1697
|
-
ints</p>
|
1698
|
-
|
1699
|
-
|
1700
|
-
</div>
|
1701
|
-
</div>
|
1702
|
-
<div class="tags">
|
1703
|
-
|
1704
|
-
|
1705
|
-
</div><table class="source_code">
|
1706
|
-
<tr>
|
1707
|
-
<td>
|
1708
|
-
<pre class="lines">
|
1709
|
-
|
1710
|
-
|
1711
|
-
183
|
1712
|
-
184
|
1713
|
-
185</pre>
|
1714
|
-
</td>
|
1715
|
-
<td>
|
1716
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 183</span>
|
1717
|
-
|
1718
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_int_attrs'>int_attrs</span>
|
1719
|
-
<span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1720
|
-
<span class='kw'>end</span></pre>
|
1721
|
-
</td>
|
1722
|
-
</tr>
|
1723
|
-
</table>
|
1724
|
-
</div>
|
1725
|
-
|
1726
|
-
<div class="method_details ">
|
1727
|
-
<h3 class="signature " id="numeric_attrs-instance_method">
|
1728
|
-
|
1729
|
-
#<strong>numeric_attrs</strong> ⇒ <tt>Object</tt>
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
</h3><div class="docstring">
|
1736
|
-
<div class="discussion">
|
1737
|
-
|
1738
|
-
<p>used by method_missing to ensure that a number is the type we expect it to
|
1739
|
-
be</p>
|
1740
|
-
|
1741
|
-
|
1742
|
-
</div>
|
1743
|
-
</div>
|
1744
|
-
<div class="tags">
|
1745
|
-
|
1746
|
-
|
1747
|
-
</div><table class="source_code">
|
1748
|
-
<tr>
|
1749
|
-
<td>
|
1750
|
-
<pre class="lines">
|
1751
|
-
|
1752
|
-
|
1753
|
-
203
|
1754
|
-
204
|
1755
|
-
205</pre>
|
1756
|
-
</td>
|
1757
|
-
<td>
|
1758
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 203</span>
|
1759
|
-
|
1760
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_numeric_attrs'>numeric_attrs</span>
|
1761
|
-
<span class='id identifier rubyid_int_attrs'>int_attrs</span> <span class='op'>+</span> <span class='id identifier rubyid_float_attrs'>float_attrs</span>
|
1762
|
-
<span class='kw'>end</span></pre>
|
1763
|
-
</td>
|
1764
|
-
</tr>
|
1765
|
-
</table>
|
1766
|
-
</div>
|
1767
|
-
|
1768
|
-
<div class="method_details ">
|
1769
|
-
<h3 class="signature " id="numeric_value_for-instance_method">
|
1770
|
-
|
1771
|
-
#<strong>numeric_value_for</strong>(attr_name, opts = {}) ⇒ <tt>Object</tt>
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
</h3><table class="source_code">
|
1778
|
-
<tr>
|
1779
|
-
<td>
|
1780
|
-
<pre class="lines">
|
1781
|
-
|
1782
|
-
|
1783
|
-
103
|
1784
|
-
104
|
1785
|
-
105
|
1786
|
-
106
|
1787
|
-
107
|
1788
|
-
108
|
1789
|
-
109
|
1790
|
-
110
|
1791
|
-
111
|
1792
|
-
112
|
1793
|
-
113
|
1794
|
-
114
|
1795
|
-
115
|
1796
|
-
116
|
1797
|
-
117
|
1798
|
-
118
|
1799
|
-
119
|
1800
|
-
120
|
1801
|
-
121</pre>
|
1802
|
-
</td>
|
1803
|
-
<td>
|
1804
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 103</span>
|
1805
|
-
|
1806
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_numeric_value_for'>numeric_value_for</span><span class='lparen'>(</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1807
|
-
<span class='id identifier rubyid_val'>val</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1808
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='kw'>if</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Numeric</span> <span class='kw'>and</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='symbol'>:integer</span>
|
1809
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_val'>val</span> <span class='kw'>if</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Numeric</span>
|
1810
|
-
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
1811
|
-
<span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_gsub!'>gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[^[:digit:]|\.]</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
|
1812
|
-
<span class='kw'>case</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span>
|
1813
|
-
<span class='kw'>when</span> <span class='symbol'>:integer</span>
|
1814
|
-
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>nil</span> <span class='op'>:</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span>
|
1815
|
-
<span class='kw'>when</span> <span class='symbol'>:float</span>
|
1816
|
-
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>nil</span> <span class='op'>:</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span><span class='rparen'>)</span>
|
1817
|
-
<span class='kw'>else</span>
|
1818
|
-
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1819
|
-
<span class='kw'>end</span>
|
1820
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1821
|
-
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
1822
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>problem with auto conversion: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1823
|
-
<span class='kw'>nil</span>
|
1824
|
-
<span class='kw'>end</span></pre>
|
1825
|
-
</td>
|
1826
|
-
</tr>
|
1827
|
-
</table>
|
1828
|
-
</div>
|
1829
|
-
|
1830
|
-
<div class="method_details ">
|
1831
|
-
<h3 class="signature " id="to_hash-instance_method">
|
1832
|
-
|
1833
|
-
#<strong>to_hash</strong> ⇒ <tt>Hash</tt>
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
</h3><div class="docstring">
|
1840
|
-
<div class="discussion">
|
1841
|
-
|
1842
|
-
<p>convert this class into a Hash structure where attributes are Hash key
|
1843
|
-
names and attribute values are Hash values</p>
|
1844
|
-
|
1845
|
-
|
1846
|
-
</div>
|
1847
|
-
</div>
|
1848
|
-
<div class="tags">
|
1849
|
-
|
1850
|
-
<p class="tag_title">Returns:</p>
|
1851
|
-
<ul class="return">
|
1852
|
-
|
1853
|
-
<li>
|
1854
|
-
|
1855
|
-
|
1856
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
—
|
1861
|
-
<div class='inline'>
|
1862
|
-
<p>with keys mapped to class attribute names</p>
|
1863
|
-
</div>
|
1864
|
-
|
1865
|
-
</li>
|
1866
|
-
|
1867
|
-
</ul>
|
1868
|
-
|
1869
|
-
</div><table class="source_code">
|
1870
|
-
<tr>
|
1871
|
-
<td>
|
1872
|
-
<pre class="lines">
|
1873
|
-
|
1874
|
-
|
1875
|
-
210
|
1876
|
-
211
|
1877
|
-
212
|
1878
|
-
213
|
1879
|
-
214</pre>
|
1880
|
-
</td>
|
1881
|
-
<td>
|
1882
|
-
<pre class="code"><span class="info file"># File 'lib/moxiworks_platform/resource.rb', line 210</span>
|
1883
|
-
|
1884
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_to_hash'>to_hash</span>
|
1885
|
-
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1886
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_attr'>attr</span><span class='op'>|</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
1887
|
-
<span class='id identifier rubyid_hash'>hash</span>
|
1888
|
-
<span class='kw'>end</span></pre>
|
1889
|
-
</td>
|
1890
|
-
</tr>
|
1891
|
-
</table>
|
1892
|
-
</div>
|
1893
|
-
|
1894
|
-
</div>
|
1895
|
-
|
1896
|
-
</div>
|
1897
|
-
|
1898
|
-
<div id="footer">
|
1899
|
-
Generated on Fri Apr 20 10:00:19 2018 by
|
1900
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1901
|
-
0.9.5 (ruby-2.2.4).
|
1902
|
-
</div>
|
1903
|
-
|
1904
|
-
</div>
|
1905
|
-
</body>
|
1906
|
-
</html>
|