helium-ruby 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +47 -0
- data/docs/Helium.html +6 -6
- data/docs/Helium/Client.html +62 -34
- data/docs/Helium/Client/Configurations.html +296 -0
- data/docs/Helium/Client/DeviceConfigurations.html +465 -0
- data/docs/Helium/Client/Elements.html +92 -18
- data/docs/Helium/Client/Http.html +86 -28
- data/docs/Helium/Client/Labels.html +29 -86
- data/docs/Helium/Client/Organizations.html +5 -75
- data/docs/Helium/Client/Sensors.html +147 -17
- data/docs/Helium/Client/Users.html +5 -9
- data/docs/Helium/ClientError.html +3 -3
- data/docs/Helium/Collection.html +1053 -0
- data/docs/Helium/Configuration.html +380 -0
- data/docs/Helium/Cursor.html +7 -3
- data/docs/Helium/DataPoint.html +16 -5
- data/docs/Helium/DeviceConfiguration.html +476 -0
- data/docs/Helium/Element.html +203 -43
- data/docs/Helium/Error.html +15 -5
- data/docs/Helium/InvalidApiKey.html +3 -3
- data/docs/Helium/Label.html +35 -36
- data/docs/Helium/Metadata.html +589 -0
- data/docs/Helium/Organization.html +236 -17
- data/docs/Helium/Resource.html +655 -161
- data/docs/Helium/Sensor.html +345 -111
- data/docs/Helium/Timeseries.html +354 -0
- data/docs/Helium/User.html +161 -18
- data/docs/Helium/Utils.html +56 -4
- data/docs/_index.html +72 -7
- data/docs/class_list.html +1 -1
- data/docs/css/style.css +8 -1
- data/docs/file.README.html +66 -6
- data/docs/frames.html +1 -1
- data/docs/index.html +66 -6
- data/docs/method_list.html +619 -139
- data/docs/top-level-namespace.html +3 -3
- data/lib/helium.rb +2 -0
- data/lib/helium/client/configurations.rb +0 -12
- data/lib/helium/client/elements.rb +0 -12
- data/lib/helium/client/labels.rb +1 -12
- data/lib/helium/client/organizations.rb +1 -47
- data/lib/helium/client/sensors.rb +0 -12
- data/lib/helium/client/users.rb +1 -3
- data/lib/helium/collection.rb +129 -0
- data/lib/helium/configuration.rb +5 -1
- data/lib/helium/element.rb +1 -1
- data/lib/helium/label.rb +1 -3
- data/lib/helium/metadata.rb +58 -0
- data/lib/helium/organization.rb +4 -4
- data/lib/helium/resource.rb +28 -29
- data/lib/helium/sensor.rb +1 -1
- data/lib/helium/version.rb +1 -1
- metadata +11 -2
data/docs/Helium/Element.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Helium::Element
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.5
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -113,7 +113,7 @@
|
|
113
113
|
<li class="public ">
|
114
114
|
<span class="summary_signature">
|
115
115
|
|
116
|
-
<a href="#
|
116
|
+
<a href="#last_seen-instance_method" title="#last_seen (instance method)">#<strong>last_seen</strong> ⇒ DateTime<sup>?</sup> </a>
|
117
117
|
|
118
118
|
|
119
119
|
|
@@ -132,7 +132,7 @@
|
|
132
132
|
|
133
133
|
|
134
134
|
|
135
|
-
<span class="summary_desc"><div class='inline'><p>
|
135
|
+
<span class="summary_desc"><div class='inline'><p>When the resource was last seen.</p>
|
136
136
|
</div></span>
|
137
137
|
|
138
138
|
</li>
|
@@ -141,7 +141,7 @@
|
|
141
141
|
<li class="public ">
|
142
142
|
<span class="summary_signature">
|
143
143
|
|
144
|
-
<a href="#
|
144
|
+
<a href="#mac-instance_method" title="#mac (instance method)">#<strong>mac</strong> ⇒ Object </a>
|
145
145
|
|
146
146
|
|
147
147
|
|
@@ -160,7 +160,7 @@
|
|
160
160
|
|
161
161
|
|
162
162
|
|
163
|
-
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute
|
163
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute mac.</p>
|
164
164
|
</div></span>
|
165
165
|
|
166
166
|
</li>
|
@@ -169,7 +169,7 @@
|
|
169
169
|
<li class="public ">
|
170
170
|
<span class="summary_signature">
|
171
171
|
|
172
|
-
<a href="#
|
172
|
+
<a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> ⇒ Object </a>
|
173
173
|
|
174
174
|
|
175
175
|
|
@@ -188,7 +188,7 @@
|
|
188
188
|
|
189
189
|
|
190
190
|
|
191
|
-
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute
|
191
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute name.</p>
|
192
192
|
</div></span>
|
193
193
|
|
194
194
|
</li>
|
@@ -201,7 +201,7 @@
|
|
201
201
|
|
202
202
|
|
203
203
|
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Resource.html" title="Helium::Resource (class)">Resource</a></span></h3>
|
204
|
-
<p class="inherited"><span class='object_link'><a href="Resource.html#id-instance_method" title="Helium::Resource#id (method)">#id</a></span>, <span class='object_link'><a href="Resource.html#type-instance_method" title="Helium::Resource#type (method)">#type</a></span></p>
|
204
|
+
<p class="inherited"><span class='object_link'><a href="Resource.html#id-instance_method" title="Helium::Resource#id (method)">#id</a></span>, <span class='object_link'><a href="Resource.html#params-instance_method" title="Helium::Resource#params (method)">#params</a></span>, <span class='object_link'><a href="Resource.html#type-instance_method" title="Helium::Resource#type (method)">#type</a></span></p>
|
205
205
|
|
206
206
|
|
207
207
|
|
@@ -232,6 +232,28 @@
|
|
232
232
|
<span class="summary_desc"><div class='inline'><p>TODO can probably generalize this a bit more.</p>
|
233
233
|
</div></span>
|
234
234
|
|
235
|
+
</li>
|
236
|
+
|
237
|
+
|
238
|
+
<li class="public ">
|
239
|
+
<span class="summary_signature">
|
240
|
+
|
241
|
+
<a href="#device_configuration-instance_method" title="#device_configuration (instance method)">#<strong>device_configuration</strong> ⇒ Object </a>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
</span>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
256
|
+
|
235
257
|
</li>
|
236
258
|
|
237
259
|
|
@@ -277,6 +299,28 @@
|
|
277
299
|
|
278
300
|
|
279
301
|
|
302
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
303
|
+
|
304
|
+
</li>
|
305
|
+
|
306
|
+
|
307
|
+
<li class="public ">
|
308
|
+
<span class="summary_signature">
|
309
|
+
|
310
|
+
<a href="#timeseries-instance_method" title="#timeseries (instance method)">#<strong>timeseries</strong>(opts = {}) ⇒ Object </a>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</span>
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
280
324
|
<span class="summary_desc"><div class='inline'></div></span>
|
281
325
|
|
282
326
|
</li>
|
@@ -295,7 +339,18 @@
|
|
295
339
|
|
296
340
|
|
297
341
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Resource.html" title="Helium::Resource (class)">Resource</a></span></h3>
|
298
|
-
<p class="inherited"><span class='object_link'><a href="Resource.html#%3D%3D-instance_method" title="Helium::Resource#== (method)">#==</a></span>, <span class='object_link'><a href="Resource.html#all-class_method" title="Helium::Resource.all (method)">all</a></span>, <span class='object_link'><a href="Resource.html#create-class_method" title="Helium::Resource.create (method)">create</a></span>, <span class='object_link'><a href="Resource.html#created_at-instance_method" title="Helium::Resource#created_at (method)">#created_at</a></span>, <span class='object_link'><a href="Resource.html#destroy-instance_method" title="Helium::Resource#destroy (method)">#destroy</a></span>, <span class='object_link'><a href="Resource.html#eql%3F-instance_method" title="Helium::Resource#eql? (method)">#eql?</a></span>, <span class='object_link'><a href="Resource.html#find-class_method" title="Helium::Resource.find (method)">find</a></span>, <span class='object_link'><a href="Resource.html#hash-instance_method" title="Helium::Resource#hash (method)">#hash</a></span>, <span class='object_link'><a href="Resource.html#to_json-instance_method" title="Helium::Resource#to_json (method)">#to_json</a></span>, <span class='object_link'><a href="Resource.html#update-instance_method" title="Helium::Resource#update (method)">#update</a></span>, <span class='object_link'><a href="Resource.html#updated_at-instance_method" title="Helium::Resource#updated_at (method)">#updated_at</a></span></p>
|
342
|
+
<p class="inherited"><span class='object_link'><a href="Resource.html#%3D%3D-instance_method" title="Helium::Resource#== (method)">#==</a></span>, <span class='object_link'><a href="Resource.html#all-class_method" title="Helium::Resource.all (method)">all</a></span>, <span class='object_link'><a href="Resource.html#all_path-class_method" title="Helium::Resource.all_path (method)">all_path</a></span>, <span class='object_link'><a href="Resource.html#create-class_method" title="Helium::Resource.create (method)">create</a></span>, <span class='object_link'><a href="Resource.html#created_at-instance_method" title="Helium::Resource#created_at (method)">#created_at</a></span>, <span class='object_link'><a href="Resource.html#destroy-instance_method" title="Helium::Resource#destroy (method)">#destroy</a></span>, <span class='object_link'><a href="Resource.html#eql%3F-instance_method" title="Helium::Resource#eql? (method)">#eql?</a></span>, <span class='object_link'><a href="Resource.html#find-class_method" title="Helium::Resource.find (method)">find</a></span>, <span class='object_link'><a href="Resource.html#hash-instance_method" title="Helium::Resource#hash (method)">#hash</a></span>, <span class='object_link'><a href="Resource.html#initialize_from_path-class_method" title="Helium::Resource.initialize_from_path (method)">initialize_from_path</a></span>, <span class='object_link'><a href="Resource.html#metadata-instance_method" title="Helium::Resource#metadata (method)">#metadata</a></span>, <span class='object_link'><a href="Resource.html#resource_name-class_method" title="Helium::Resource.resource_name (method)">resource_name</a></span>, <span class='object_link'><a href="Resource.html#resource_name-instance_method" title="Helium::Resource#resource_name (method)">#resource_name</a></span>, <span class='object_link'><a href="Resource.html#resource_path-instance_method" title="Helium::Resource#resource_path (method)">#resource_path</a></span>, <span class='object_link'><a href="Resource.html#singleton-class_method" title="Helium::Resource.singleton (method)">singleton</a></span>, <span class='object_link'><a href="Resource.html#to_json-instance_method" title="Helium::Resource#to_json (method)">#to_json</a></span>, <span class='object_link'><a href="Resource.html#update-instance_method" title="Helium::Resource#update (method)">#update</a></span>, <span class='object_link'><a href="Resource.html#updated_at-instance_method" title="Helium::Resource#updated_at (method)">#updated_at</a></span></p>
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Utils.html" title="Helium::Utils (module)">Utils</a></span></h3>
|
353
|
+
<p class="inherited"><span class='object_link'><a href="Utils.html#datetime_to_iso-instance_method" title="Helium::Utils#datetime_to_iso (method)">#datetime_to_iso</a></span>, <span class='object_link'><a href="Utils.html#kebab_case-instance_method" title="Helium::Utils#kebab_case (method)">#kebab_case</a></span></p>
|
299
354
|
<div id="constructor_details" class="method_details_list">
|
300
355
|
<h2>Constructor Details</h2>
|
301
356
|
|
@@ -338,9 +393,9 @@
|
|
338
393
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</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>
|
339
394
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
340
395
|
|
341
|
-
<span class='ivar'>@name</span>
|
342
|
-
<span class='ivar'>@mac</span>
|
343
|
-
<span class='ivar'>@
|
396
|
+
<span class='ivar'>@name</span> <span class='op'>=</span> <span class='ivar'>@params</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>attributes</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
397
|
+
<span class='ivar'>@mac</span> <span class='op'>=</span> <span class='ivar'>@params</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>meta</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>mac</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
398
|
+
<span class='ivar'>@last_seen</span> <span class='op'>=</span> <span class='ivar'>@params</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>meta</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>last-seen</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
344
399
|
<span class='kw'>end</span></pre>
|
345
400
|
</td>
|
346
401
|
</tr>
|
@@ -355,9 +410,9 @@
|
|
355
410
|
|
356
411
|
<span id=""></span>
|
357
412
|
<div class="method_details first">
|
358
|
-
<h3 class="signature first" id="
|
413
|
+
<h3 class="signature first" id="last_seen-instance_method">
|
359
414
|
|
360
|
-
#<strong>
|
415
|
+
#<strong>last_seen</strong> ⇒ <tt>DateTime</tt><sup>?</sup> <span class="extras">(readonly)</span>
|
361
416
|
|
362
417
|
|
363
418
|
|
@@ -365,13 +420,30 @@
|
|
365
420
|
|
366
421
|
</h3><div class="docstring">
|
367
422
|
<div class="discussion">
|
368
|
-
<p>Returns the
|
423
|
+
<p>Returns when the resource was last seen</p>
|
369
424
|
|
370
425
|
|
371
426
|
</div>
|
372
427
|
</div>
|
373
428
|
<div class="tags">
|
374
429
|
|
430
|
+
<p class="tag_title">Returns:</p>
|
431
|
+
<ul class="return">
|
432
|
+
|
433
|
+
<li>
|
434
|
+
|
435
|
+
|
436
|
+
<span class='type'>(<tt>DateTime</tt>, <tt>nil</tt>)</span>
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
—
|
441
|
+
<div class='inline'><p>when the resource was last seen</p>
|
442
|
+
</div>
|
443
|
+
|
444
|
+
</li>
|
445
|
+
|
446
|
+
</ul>
|
375
447
|
|
376
448
|
</div><table class="source_code">
|
377
449
|
<tr>
|
@@ -379,15 +451,15 @@
|
|
379
451
|
<pre class="lines">
|
380
452
|
|
381
453
|
|
382
|
-
|
383
|
-
|
384
|
-
|
454
|
+
22
|
455
|
+
23
|
456
|
+
24</pre>
|
385
457
|
</td>
|
386
458
|
<td>
|
387
|
-
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line
|
459
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 22</span>
|
388
460
|
|
389
|
-
<span class='kw'>def</span> <span class='id identifier
|
390
|
-
<span class='ivar'>@
|
461
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_last_seen'>last_seen</span>
|
462
|
+
<span class='ivar'>@last_seen</span>
|
391
463
|
<span class='kw'>end</span></pre>
|
392
464
|
</td>
|
393
465
|
</tr>
|
@@ -397,9 +469,9 @@
|
|
397
469
|
|
398
470
|
<span id=""></span>
|
399
471
|
<div class="method_details ">
|
400
|
-
<h3 class="signature " id="
|
472
|
+
<h3 class="signature " id="mac-instance_method">
|
401
473
|
|
402
|
-
#<strong>
|
474
|
+
#<strong>mac</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
403
475
|
|
404
476
|
|
405
477
|
|
@@ -407,7 +479,7 @@
|
|
407
479
|
|
408
480
|
</h3><div class="docstring">
|
409
481
|
<div class="discussion">
|
410
|
-
<p>Returns the value of attribute
|
482
|
+
<p>Returns the value of attribute mac</p>
|
411
483
|
|
412
484
|
|
413
485
|
</div>
|
@@ -428,8 +500,8 @@
|
|
428
500
|
<td>
|
429
501
|
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 3</span>
|
430
502
|
|
431
|
-
<span class='kw'>def</span> <span class='id identifier
|
432
|
-
<span class='ivar'>@
|
503
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_mac'>mac</span>
|
504
|
+
<span class='ivar'>@mac</span>
|
433
505
|
<span class='kw'>end</span></pre>
|
434
506
|
</td>
|
435
507
|
</tr>
|
@@ -439,9 +511,9 @@
|
|
439
511
|
|
440
512
|
<span id=""></span>
|
441
513
|
<div class="method_details ">
|
442
|
-
<h3 class="signature " id="
|
514
|
+
<h3 class="signature " id="name-instance_method">
|
443
515
|
|
444
|
-
#<strong>
|
516
|
+
#<strong>name</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
445
517
|
|
446
518
|
|
447
519
|
|
@@ -449,7 +521,7 @@
|
|
449
521
|
|
450
522
|
</h3><div class="docstring">
|
451
523
|
<div class="discussion">
|
452
|
-
<p>Returns the value of attribute
|
524
|
+
<p>Returns the value of attribute name</p>
|
453
525
|
|
454
526
|
|
455
527
|
</div>
|
@@ -470,8 +542,8 @@
|
|
470
542
|
<td>
|
471
543
|
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 3</span>
|
472
544
|
|
473
|
-
<span class='kw'>def</span> <span class='id identifier
|
474
|
-
<span class='ivar'>@
|
545
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
546
|
+
<span class='ivar'>@name</span>
|
475
547
|
<span class='kw'>end</span></pre>
|
476
548
|
</td>
|
477
549
|
</tr>
|
@@ -510,27 +582,57 @@
|
|
510
582
|
<pre class="lines">
|
511
583
|
|
512
584
|
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
585
|
+
28
|
586
|
+
29
|
587
|
+
30
|
588
|
+
31
|
589
|
+
32
|
590
|
+
33
|
591
|
+
34</pre>
|
520
592
|
</td>
|
521
593
|
<td>
|
522
|
-
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line
|
594
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 28</span>
|
523
595
|
|
524
596
|
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
525
597
|
<span class='kw'>super</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='lbrace'>{</span>
|
526
598
|
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
527
599
|
<span class='label'>mac:</span> <span class='id identifier rubyid_mac'>mac</span><span class='comma'>,</span>
|
528
|
-
<span class='label'>
|
600
|
+
<span class='label'>last_seen:</span> <span class='id identifier rubyid_last_seen'>last_seen</span>
|
529
601
|
<span class='rbrace'>}</span><span class='rparen'>)</span>
|
530
602
|
<span class='kw'>end</span></pre>
|
531
603
|
</td>
|
532
604
|
</tr>
|
533
605
|
</table>
|
606
|
+
</div>
|
607
|
+
|
608
|
+
<div class="method_details ">
|
609
|
+
<h3 class="signature " id="device_configuration-instance_method">
|
610
|
+
|
611
|
+
#<strong>device_configuration</strong> ⇒ <tt>Object</tt>
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
</h3><table class="source_code">
|
618
|
+
<tr>
|
619
|
+
<td>
|
620
|
+
<pre class="lines">
|
621
|
+
|
622
|
+
|
623
|
+
17
|
624
|
+
18
|
625
|
+
19</pre>
|
626
|
+
</td>
|
627
|
+
<td>
|
628
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 17</span>
|
629
|
+
|
630
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_device_configuration'>device_configuration</span>
|
631
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_element_device_configuration'>element_device_configuration</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
632
|
+
<span class='kw'>end</span></pre>
|
633
|
+
</td>
|
634
|
+
</tr>
|
635
|
+
</table>
|
534
636
|
</div>
|
535
637
|
|
536
638
|
<div class="method_details ">
|
@@ -556,7 +658,65 @@
|
|
556
658
|
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 13</span>
|
557
659
|
|
558
660
|
<span class='kw'>def</span> <span class='id identifier rubyid_sensors'>sensors</span>
|
559
|
-
<span class='
|
661
|
+
<span class='const'>Collection</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>klass:</span> <span class='const'>Sensor</span><span class='comma'>,</span> <span class='label'>client:</span> <span class='ivar'>@client</span><span class='comma'>,</span> <span class='label'>belongs_to:</span> <span class='kw'>self</span><span class='rparen'>)</span>
|
662
|
+
<span class='kw'>end</span></pre>
|
663
|
+
</td>
|
664
|
+
</tr>
|
665
|
+
</table>
|
666
|
+
</div>
|
667
|
+
|
668
|
+
<div class="method_details ">
|
669
|
+
<h3 class="signature " id="timeseries-instance_method">
|
670
|
+
|
671
|
+
#<strong>timeseries</strong>(opts = {}) ⇒ <tt>Object</tt>
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
|
677
|
+
</h3><table class="source_code">
|
678
|
+
<tr>
|
679
|
+
<td>
|
680
|
+
<pre class="lines">
|
681
|
+
|
682
|
+
|
683
|
+
36
|
684
|
+
37
|
685
|
+
38
|
686
|
+
39
|
687
|
+
40
|
688
|
+
41
|
689
|
+
42
|
690
|
+
43
|
691
|
+
44
|
692
|
+
45
|
693
|
+
46
|
694
|
+
47
|
695
|
+
48
|
696
|
+
49
|
697
|
+
50
|
698
|
+
51
|
699
|
+
52</pre>
|
700
|
+
</td>
|
701
|
+
<td>
|
702
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 36</span>
|
703
|
+
|
704
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_timeseries'>timeseries</span><span class='lparen'>(</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>
|
705
|
+
<span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:size</span><span class='comma'>,</span> <span class='int'>1000</span><span class='rparen'>)</span>
|
706
|
+
<span class='id identifier rubyid_port'>port</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:port</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
707
|
+
<span class='id identifier rubyid_start_time'>start_time</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:start_time</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
708
|
+
<span class='id identifier rubyid_end_time'>end_time</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:end_time</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
709
|
+
<span class='id identifier rubyid_aggtype'>aggtype</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:aggtype</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
710
|
+
<span class='id identifier rubyid_aggsize'>aggsize</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:aggsize</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
711
|
+
|
712
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_element_timeseries'>element_timeseries</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span>
|
713
|
+
<span class='label'>size:</span> <span class='id identifier rubyid_size'>size</span><span class='comma'>,</span>
|
714
|
+
<span class='label'>port:</span> <span class='id identifier rubyid_port'>port</span><span class='comma'>,</span>
|
715
|
+
<span class='label'>start_time:</span> <span class='id identifier rubyid_start_time'>start_time</span><span class='comma'>,</span>
|
716
|
+
<span class='label'>end_time:</span> <span class='id identifier rubyid_end_time'>end_time</span><span class='comma'>,</span>
|
717
|
+
<span class='label'>aggtype:</span> <span class='id identifier rubyid_aggtype'>aggtype</span><span class='comma'>,</span>
|
718
|
+
<span class='label'>aggsize:</span> <span class='id identifier rubyid_aggsize'>aggsize</span>
|
719
|
+
<span class='rparen'>)</span>
|
560
720
|
<span class='kw'>end</span></pre>
|
561
721
|
</td>
|
562
722
|
</tr>
|
@@ -568,9 +728,9 @@
|
|
568
728
|
</div>
|
569
729
|
|
570
730
|
<div id="footer">
|
571
|
-
Generated on Thu
|
731
|
+
Generated on Thu Jan 12 15:58:34 2017 by
|
572
732
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
573
|
-
0.9.
|
733
|
+
0.9.5 (ruby-2.3.1).
|
574
734
|
</div>
|
575
735
|
|
576
736
|
</div>
|
data/docs/Helium/Error.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Exception: Helium::Error
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.5
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -229,14 +229,24 @@ response message</p>
|
|
229
229
|
17
|
230
230
|
18
|
231
231
|
19
|
232
|
-
20
|
232
|
+
20
|
233
|
+
21
|
234
|
+
22
|
235
|
+
23
|
236
|
+
24
|
237
|
+
25</pre>
|
233
238
|
</td>
|
234
239
|
<td>
|
235
240
|
<pre class="code"><span class="info file"># File 'lib/helium/error.rb', line 10</span>
|
236
241
|
|
237
242
|
<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_response'>response</span><span class='rparen'>)</span>
|
238
243
|
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span>
|
239
|
-
<span class='
|
244
|
+
<span class='comment'># Default the error message in the case of no error body
|
245
|
+
</span> <span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>&&</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>>=</span> <span class='int'>2</span>
|
246
|
+
<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='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>detail</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
|
247
|
+
<span class='kw'>else</span>
|
248
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unknown error with code: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
249
|
+
<span class='kw'>end</span>
|
240
250
|
|
241
251
|
<span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='kw'>case</span> <span class='id identifier rubyid_status'>status</span>
|
242
252
|
<span class='kw'>when</span> <span class='int'>401</span> <span class='kw'>then</span> <span class='const'>Helium</span><span class='op'>::</span><span class='const'>InvalidApiKey</span>
|
@@ -255,9 +265,9 @@ response message</p>
|
|
255
265
|
</div>
|
256
266
|
|
257
267
|
<div id="footer">
|
258
|
-
Generated on Thu
|
268
|
+
Generated on Thu Jan 12 15:58:34 2017 by
|
259
269
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
260
|
-
0.9.
|
270
|
+
0.9.5 (ruby-2.3.1).
|
261
271
|
</div>
|
262
272
|
|
263
273
|
</div>
|