helium-ruby 0.25.0 → 0.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/Helium.html +2 -2
- data/docs/Helium/Client.html +2 -2
- data/docs/Helium/Client/Configurations.html +1 -1
- data/docs/Helium/Client/DeviceConfigurations.html +1 -1
- data/docs/Helium/Client/Elements.html +1 -1
- data/docs/Helium/Client/Http.html +5 -5
- data/docs/Helium/Client/Labels.html +1 -116
- data/docs/Helium/Client/Organizations.html +1 -1
- data/docs/Helium/Client/Sensors.html +1 -1
- data/docs/Helium/Client/Users.html +1 -1
- data/docs/Helium/ClientError.html +1 -1
- data/docs/Helium/Collection.html +199 -1
- data/docs/Helium/Configuration.html +1 -1
- data/docs/Helium/Cursor.html +1 -1
- data/docs/Helium/DataPoint.html +1 -1
- data/docs/Helium/DeviceConfiguration.html +1 -1
- data/docs/Helium/Element.html +419 -28
- data/docs/Helium/Error.html +1 -1
- data/docs/Helium/InvalidApiKey.html +1 -1
- data/docs/Helium/Label.html +285 -21
- data/docs/Helium/Metadata.html +1 -1
- data/docs/Helium/Organization.html +1 -1
- data/docs/Helium/Resource.html +2 -2
- data/docs/Helium/Sensor.html +308 -36
- data/docs/Helium/Timeseries.html +1 -1
- data/docs/Helium/User.html +1 -1
- data/docs/Helium/Utils.html +1 -1
- data/docs/_index.html +1 -1
- data/docs/file.README.html +1 -1
- data/docs/index.html +1 -1
- data/docs/method_list.html +287 -151
- data/docs/top-level-namespace.html +1 -1
- data/lib/helium.rb +1 -0
- data/lib/helium/client.rb +12 -10
- data/lib/helium/client/helium_scripts.rb +105 -0
- data/lib/helium/helium_script.rb +73 -0
- data/lib/helium/sensor.rb +6 -0
- data/lib/helium/version.rb +1 -1
- metadata +5 -3
@@ -370,7 +370,7 @@
|
|
370
370
|
</div>
|
371
371
|
|
372
372
|
<div id="footer">
|
373
|
-
Generated on
|
373
|
+
Generated on Wed Apr 5 13:55:54 2017 by
|
374
374
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
375
375
|
0.9.5 (ruby-2.3.1).
|
376
376
|
</div>
|
data/docs/Helium/Cursor.html
CHANGED
@@ -351,7 +351,7 @@
|
|
351
351
|
</div>
|
352
352
|
|
353
353
|
<div id="footer">
|
354
|
-
Generated on
|
354
|
+
Generated on Wed Apr 5 13:55:53 2017 by
|
355
355
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
356
356
|
0.9.5 (ruby-2.3.1).
|
357
357
|
</div>
|
data/docs/Helium/DataPoint.html
CHANGED
@@ -770,7 +770,7 @@
|
|
770
770
|
</div>
|
771
771
|
|
772
772
|
<div id="footer">
|
773
|
-
Generated on
|
773
|
+
Generated on Wed Apr 5 13:55:54 2017 by
|
774
774
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
775
775
|
0.9.5 (ruby-2.3.1).
|
776
776
|
</div>
|
@@ -466,7 +466,7 @@
|
|
466
466
|
</div>
|
467
467
|
|
468
468
|
<div id="footer">
|
469
|
-
Generated on
|
469
|
+
Generated on Wed Apr 5 13:55:54 2017 by
|
470
470
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
471
471
|
0.9.5 (ruby-2.3.1).
|
472
472
|
</div>
|
data/docs/Helium/Element.html
CHANGED
@@ -110,6 +110,34 @@
|
|
110
110
|
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
111
111
|
<ul class="summary">
|
112
112
|
|
113
|
+
<li class="public ">
|
114
|
+
<span class="summary_signature">
|
115
|
+
|
116
|
+
<a href="#device_type-instance_method" title="#device_type (instance method)">#<strong>device_type</strong> ⇒ Object </a>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
</span>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<span class="note title readonly">readonly</span>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute device_type.</p>
|
136
|
+
</div></span>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
113
141
|
<li class="public ">
|
114
142
|
<span class="summary_signature">
|
115
143
|
|
@@ -205,6 +233,37 @@
|
|
205
233
|
|
206
234
|
|
207
235
|
|
236
|
+
<h2>
|
237
|
+
Class Method Summary
|
238
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
239
|
+
</h2>
|
240
|
+
|
241
|
+
<ul class="summary">
|
242
|
+
|
243
|
+
<li class="public ">
|
244
|
+
<span class="summary_signature">
|
245
|
+
|
246
|
+
<a href="#all_path-class_method" title="all_path (class method)">.<strong>all_path</strong> ⇒ Object </a>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</span>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
261
|
+
|
262
|
+
</li>
|
263
|
+
|
264
|
+
|
265
|
+
</ul>
|
266
|
+
|
208
267
|
<h2>
|
209
268
|
Instance Method Summary
|
210
269
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
@@ -215,6 +274,28 @@
|
|
215
274
|
<li class="public ">
|
216
275
|
<span class="summary_signature">
|
217
276
|
|
277
|
+
<a href="#add_labels-instance_method" title="#add_labels (instance method)">#<strong>add_labels</strong>(labels_to_add = []) ⇒ Object </a>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
</span>
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
292
|
+
|
293
|
+
</li>
|
294
|
+
|
295
|
+
|
296
|
+
<li class="public ">
|
297
|
+
<span class="summary_signature">
|
298
|
+
|
218
299
|
<a href="#as_json-instance_method" title="#as_json (instance method)">#<strong>as_json</strong> ⇒ Object </a>
|
219
300
|
|
220
301
|
|
@@ -279,6 +360,72 @@
|
|
279
360
|
<span class="summary_desc"><div class='inline'><p>A new instance of Element.</p>
|
280
361
|
</div></span>
|
281
362
|
|
363
|
+
</li>
|
364
|
+
|
365
|
+
|
366
|
+
<li class="public ">
|
367
|
+
<span class="summary_signature">
|
368
|
+
|
369
|
+
<a href="#labels-instance_method" title="#labels (instance method)">#<strong>labels</strong> ⇒ Object </a>
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
</span>
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
384
|
+
|
385
|
+
</li>
|
386
|
+
|
387
|
+
|
388
|
+
<li class="public ">
|
389
|
+
<span class="summary_signature">
|
390
|
+
|
391
|
+
<a href="#remove_labels-instance_method" title="#remove_labels (instance method)">#<strong>remove_labels</strong>(labels_to_remove = []) ⇒ Object </a>
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
</span>
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
406
|
+
|
407
|
+
</li>
|
408
|
+
|
409
|
+
|
410
|
+
<li class="public ">
|
411
|
+
<span class="summary_signature">
|
412
|
+
|
413
|
+
<a href="#replace_labels-instance_method" title="#replace_labels (instance method)">#<strong>replace_labels</strong>(labels_to_replace = []) ⇒ Object </a>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
</span>
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
428
|
+
|
282
429
|
</li>
|
283
430
|
|
284
431
|
|
@@ -339,7 +486,7 @@
|
|
339
486
|
|
340
487
|
|
341
488
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Resource.html" title="Helium::Resource (class)">Resource</a></span></h3>
|
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#
|
489
|
+
<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#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
490
|
|
344
491
|
|
345
492
|
|
@@ -385,7 +532,8 @@
|
|
385
532
|
8
|
386
533
|
9
|
387
534
|
10
|
388
|
-
11
|
535
|
+
11
|
536
|
+
12</pre>
|
389
537
|
</td>
|
390
538
|
<td>
|
391
539
|
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 5</span>
|
@@ -393,9 +541,10 @@
|
|
393
541
|
<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>
|
394
542
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
395
543
|
|
396
|
-
<span class='ivar'>@name</span>
|
397
|
-
<span class='ivar'>@mac</span>
|
398
|
-
<span class='ivar'>@last_seen</span>
|
544
|
+
<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>
|
545
|
+
<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>
|
546
|
+
<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>
|
547
|
+
<span class='ivar'>@device_type</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'>device-type</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
399
548
|
<span class='kw'>end</span></pre>
|
400
549
|
</td>
|
401
550
|
</tr>
|
@@ -410,7 +559,49 @@
|
|
410
559
|
|
411
560
|
<span id=""></span>
|
412
561
|
<div class="method_details first">
|
413
|
-
<h3 class="signature first" id="
|
562
|
+
<h3 class="signature first" id="device_type-instance_method">
|
563
|
+
|
564
|
+
#<strong>device_type</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
</h3><div class="docstring">
|
571
|
+
<div class="discussion">
|
572
|
+
<p>Returns the value of attribute device_type</p>
|
573
|
+
|
574
|
+
|
575
|
+
</div>
|
576
|
+
</div>
|
577
|
+
<div class="tags">
|
578
|
+
|
579
|
+
|
580
|
+
</div><table class="source_code">
|
581
|
+
<tr>
|
582
|
+
<td>
|
583
|
+
<pre class="lines">
|
584
|
+
|
585
|
+
|
586
|
+
3
|
587
|
+
4
|
588
|
+
5</pre>
|
589
|
+
</td>
|
590
|
+
<td>
|
591
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 3</span>
|
592
|
+
|
593
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_device_type'>device_type</span>
|
594
|
+
<span class='ivar'>@device_type</span>
|
595
|
+
<span class='kw'>end</span></pre>
|
596
|
+
</td>
|
597
|
+
</tr>
|
598
|
+
</table>
|
599
|
+
</div>
|
600
|
+
|
601
|
+
|
602
|
+
<span id=""></span>
|
603
|
+
<div class="method_details ">
|
604
|
+
<h3 class="signature " id="last_seen-instance_method">
|
414
605
|
|
415
606
|
#<strong>last_seen</strong> ⇒ <tt>DateTime</tt><sup>?</sup> <span class="extras">(readonly)</span>
|
416
607
|
|
@@ -451,12 +642,12 @@
|
|
451
642
|
<pre class="lines">
|
452
643
|
|
453
644
|
|
454
|
-
|
455
|
-
|
456
|
-
|
645
|
+
31
|
646
|
+
32
|
647
|
+
33</pre>
|
457
648
|
</td>
|
458
649
|
<td>
|
459
|
-
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line
|
650
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 31</span>
|
460
651
|
|
461
652
|
<span class='kw'>def</span> <span class='id identifier rubyid_last_seen'>last_seen</span>
|
462
653
|
<span class='ivar'>@last_seen</span>
|
@@ -553,12 +744,94 @@
|
|
553
744
|
</div>
|
554
745
|
|
555
746
|
|
747
|
+
<div id="class_method_details" class="method_details_list">
|
748
|
+
<h2>Class Method Details</h2>
|
749
|
+
|
750
|
+
|
751
|
+
<div class="method_details first">
|
752
|
+
<h3 class="signature first" id="all_path-class_method">
|
753
|
+
|
754
|
+
.<strong>all_path</strong> ⇒ <tt>Object</tt>
|
755
|
+
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
</h3><table class="source_code">
|
761
|
+
<tr>
|
762
|
+
<td>
|
763
|
+
<pre class="lines">
|
764
|
+
|
765
|
+
|
766
|
+
18
|
767
|
+
19
|
768
|
+
20</pre>
|
769
|
+
</td>
|
770
|
+
<td>
|
771
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 18</span>
|
772
|
+
|
773
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_all_path'>all_path</span>
|
774
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/element?include=label</span><span class='tstring_end'>"</span></span>
|
775
|
+
<span class='kw'>end</span></pre>
|
776
|
+
</td>
|
777
|
+
</tr>
|
778
|
+
</table>
|
779
|
+
</div>
|
780
|
+
|
781
|
+
</div>
|
782
|
+
|
556
783
|
<div id="instance_method_details" class="method_details_list">
|
557
784
|
<h2>Instance Method Details</h2>
|
558
785
|
|
559
786
|
|
560
787
|
<div class="method_details first">
|
561
|
-
<h3 class="signature first" id="
|
788
|
+
<h3 class="signature first" id="add_labels-instance_method">
|
789
|
+
|
790
|
+
#<strong>add_labels</strong>(labels_to_add = []) ⇒ <tt>Object</tt>
|
791
|
+
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
</h3><table class="source_code">
|
797
|
+
<tr>
|
798
|
+
<td>
|
799
|
+
<pre class="lines">
|
800
|
+
|
801
|
+
|
802
|
+
64
|
803
|
+
65
|
804
|
+
66
|
805
|
+
67
|
806
|
+
68
|
807
|
+
69
|
808
|
+
70
|
809
|
+
71
|
810
|
+
72
|
811
|
+
73
|
812
|
+
74</pre>
|
813
|
+
</td>
|
814
|
+
<td>
|
815
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 64</span>
|
816
|
+
|
817
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_labels'>add_labels</span><span class='lparen'>(</span><span class='id identifier rubyid_labels_to_add'>labels_to_add</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
818
|
+
<span class='comment'># There's no first-class support for modifying the labels of a element in
|
819
|
+
</span> <span class='comment'># the API yet, so we modify each label's relationship to the element. Once
|
820
|
+
</span> <span class='comment'># this is supported in the API, this can use #add_relationships instead.
|
821
|
+
</span> <span class='comment'># Same comment applies for the following 3 functions
|
822
|
+
</span> <span class='id identifier rubyid_labels_to_add'>labels_to_add</span> <span class='op'>=</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_labels_to_add'>labels_to_add</span><span class='rparen'>)</span>
|
823
|
+
<span class='id identifier rubyid_labels_to_add'>labels_to_add</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_label'>label</span><span class='op'>|</span>
|
824
|
+
<span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_add_elements'>add_elements</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
825
|
+
<span class='kw'>end</span>
|
826
|
+
<span class='kw'>self</span>
|
827
|
+
<span class='kw'>end</span></pre>
|
828
|
+
</td>
|
829
|
+
</tr>
|
830
|
+
</table>
|
831
|
+
</div>
|
832
|
+
|
833
|
+
<div class="method_details ">
|
834
|
+
<h3 class="signature " id="as_json-instance_method">
|
562
835
|
|
563
836
|
#<strong>as_json</strong> ⇒ <tt>Object</tt>
|
564
837
|
|
@@ -582,22 +855,24 @@
|
|
582
855
|
<pre class="lines">
|
583
856
|
|
584
857
|
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
858
|
+
55
|
859
|
+
56
|
860
|
+
57
|
861
|
+
58
|
862
|
+
59
|
863
|
+
60
|
864
|
+
61
|
865
|
+
62</pre>
|
592
866
|
</td>
|
593
867
|
<td>
|
594
|
-
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line
|
868
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 55</span>
|
595
869
|
|
596
870
|
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
597
871
|
<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>
|
598
872
|
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
599
873
|
<span class='label'>mac:</span> <span class='id identifier rubyid_mac'>mac</span><span class='comma'>,</span>
|
600
|
-
<span class='label'>last_seen:</span> <span class='id identifier rubyid_last_seen'>last_seen</span>
|
874
|
+
<span class='label'>last_seen:</span> <span class='id identifier rubyid_last_seen'>last_seen</span><span class='comma'>,</span>
|
875
|
+
<span class='label'>device_type:</span> <span class='id identifier rubyid_device_type'>device_type</span>
|
601
876
|
<span class='rbrace'>}</span><span class='rparen'>)</span>
|
602
877
|
<span class='kw'>end</span></pre>
|
603
878
|
</td>
|
@@ -620,12 +895,12 @@
|
|
620
895
|
<pre class="lines">
|
621
896
|
|
622
897
|
|
623
|
-
|
624
|
-
|
625
|
-
|
898
|
+
26
|
899
|
+
27
|
900
|
+
28</pre>
|
626
901
|
</td>
|
627
902
|
<td>
|
628
|
-
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line
|
903
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 26</span>
|
629
904
|
|
630
905
|
<span class='kw'>def</span> <span class='id identifier rubyid_device_configuration'>device_configuration</span>
|
631
906
|
<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>
|
@@ -633,6 +908,122 @@
|
|
633
908
|
</td>
|
634
909
|
</tr>
|
635
910
|
</table>
|
911
|
+
</div>
|
912
|
+
|
913
|
+
<div class="method_details ">
|
914
|
+
<h3 class="signature " id="labels-instance_method">
|
915
|
+
|
916
|
+
#<strong>labels</strong> ⇒ <tt>Object</tt>
|
917
|
+
|
918
|
+
|
919
|
+
|
920
|
+
|
921
|
+
|
922
|
+
</h3><table class="source_code">
|
923
|
+
<tr>
|
924
|
+
<td>
|
925
|
+
<pre class="lines">
|
926
|
+
|
927
|
+
|
928
|
+
22
|
929
|
+
23
|
930
|
+
24</pre>
|
931
|
+
</td>
|
932
|
+
<td>
|
933
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 22</span>
|
934
|
+
|
935
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_labels'>labels</span>
|
936
|
+
<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'>Label</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>
|
937
|
+
<span class='kw'>end</span></pre>
|
938
|
+
</td>
|
939
|
+
</tr>
|
940
|
+
</table>
|
941
|
+
</div>
|
942
|
+
|
943
|
+
<div class="method_details ">
|
944
|
+
<h3 class="signature " id="remove_labels-instance_method">
|
945
|
+
|
946
|
+
#<strong>remove_labels</strong>(labels_to_remove = []) ⇒ <tt>Object</tt>
|
947
|
+
|
948
|
+
|
949
|
+
|
950
|
+
|
951
|
+
|
952
|
+
</h3><table class="source_code">
|
953
|
+
<tr>
|
954
|
+
<td>
|
955
|
+
<pre class="lines">
|
956
|
+
|
957
|
+
|
958
|
+
89
|
959
|
+
90
|
960
|
+
91
|
961
|
+
92
|
962
|
+
93
|
963
|
+
94
|
964
|
+
95</pre>
|
965
|
+
</td>
|
966
|
+
<td>
|
967
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 89</span>
|
968
|
+
|
969
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_remove_labels'>remove_labels</span><span class='lparen'>(</span><span class='id identifier rubyid_labels_to_remove'>labels_to_remove</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
970
|
+
<span class='id identifier rubyid_labels_to_remove'>labels_to_remove</span> <span class='op'>=</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_labels_to_remove'>labels_to_remove</span><span class='rparen'>)</span>
|
971
|
+
<span class='id identifier rubyid_labels_to_remove'>labels_to_remove</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_label'>label</span><span class='op'>|</span>
|
972
|
+
<span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_remove_elements'>remove_elements</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
973
|
+
<span class='kw'>end</span>
|
974
|
+
<span class='kw'>self</span>
|
975
|
+
<span class='kw'>end</span></pre>
|
976
|
+
</td>
|
977
|
+
</tr>
|
978
|
+
</table>
|
979
|
+
</div>
|
980
|
+
|
981
|
+
<div class="method_details ">
|
982
|
+
<h3 class="signature " id="replace_labels-instance_method">
|
983
|
+
|
984
|
+
#<strong>replace_labels</strong>(labels_to_replace = []) ⇒ <tt>Object</tt>
|
985
|
+
|
986
|
+
|
987
|
+
|
988
|
+
|
989
|
+
|
990
|
+
</h3><table class="source_code">
|
991
|
+
<tr>
|
992
|
+
<td>
|
993
|
+
<pre class="lines">
|
994
|
+
|
995
|
+
|
996
|
+
76
|
997
|
+
77
|
998
|
+
78
|
999
|
+
79
|
1000
|
+
80
|
1001
|
+
81
|
1002
|
+
82
|
1003
|
+
83
|
1004
|
+
84
|
1005
|
+
85
|
1006
|
+
86
|
1007
|
+
87</pre>
|
1008
|
+
</td>
|
1009
|
+
<td>
|
1010
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 76</span>
|
1011
|
+
|
1012
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_replace_labels'>replace_labels</span><span class='lparen'>(</span><span class='id identifier rubyid_labels_to_replace'>labels_to_replace</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1013
|
+
<span class='comment'># To support replacement, we remove this element from each label, and then
|
1014
|
+
</span> <span class='comment'># add it to the specified set
|
1015
|
+
</span> <span class='id identifier rubyid_labels_to_replace'>labels_to_replace</span> <span class='op'>=</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_labels_to_replace'>labels_to_replace</span><span class='rparen'>)</span>
|
1016
|
+
<span class='id identifier rubyid_labels'>labels</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_label'>label</span><span class='op'>|</span>
|
1017
|
+
<span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_remove_elements'>remove_elements</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
1018
|
+
<span class='kw'>end</span>
|
1019
|
+
<span class='id identifier rubyid_labels_to_replace'>labels_to_replace</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_label'>label</span><span class='op'>|</span>
|
1020
|
+
<span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_add_elements'>add_elements</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
1021
|
+
<span class='kw'>end</span>
|
1022
|
+
<span class='kw'>self</span>
|
1023
|
+
<span class='kw'>end</span></pre>
|
1024
|
+
</td>
|
1025
|
+
</tr>
|
1026
|
+
</table>
|
636
1027
|
</div>
|
637
1028
|
|
638
1029
|
<div class="method_details ">
|
@@ -650,12 +1041,12 @@
|
|
650
1041
|
<pre class="lines">
|
651
1042
|
|
652
1043
|
|
653
|
-
13
|
654
1044
|
14
|
655
|
-
15
|
1045
|
+
15
|
1046
|
+
16</pre>
|
656
1047
|
</td>
|
657
1048
|
<td>
|
658
|
-
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line
|
1049
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 14</span>
|
659
1050
|
|
660
1051
|
<span class='kw'>def</span> <span class='id identifier rubyid_sensors'>sensors</span>
|
661
1052
|
<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>
|
@@ -728,7 +1119,7 @@
|
|
728
1119
|
</div>
|
729
1120
|
|
730
1121
|
<div id="footer">
|
731
|
-
Generated on
|
1122
|
+
Generated on Wed Apr 5 13:55:54 2017 by
|
732
1123
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
733
1124
|
0.9.5 (ruby-2.3.1).
|
734
1125
|
</div>
|