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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +47 -0
  3. data/docs/Helium.html +6 -6
  4. data/docs/Helium/Client.html +62 -34
  5. data/docs/Helium/Client/Configurations.html +296 -0
  6. data/docs/Helium/Client/DeviceConfigurations.html +465 -0
  7. data/docs/Helium/Client/Elements.html +92 -18
  8. data/docs/Helium/Client/Http.html +86 -28
  9. data/docs/Helium/Client/Labels.html +29 -86
  10. data/docs/Helium/Client/Organizations.html +5 -75
  11. data/docs/Helium/Client/Sensors.html +147 -17
  12. data/docs/Helium/Client/Users.html +5 -9
  13. data/docs/Helium/ClientError.html +3 -3
  14. data/docs/Helium/Collection.html +1053 -0
  15. data/docs/Helium/Configuration.html +380 -0
  16. data/docs/Helium/Cursor.html +7 -3
  17. data/docs/Helium/DataPoint.html +16 -5
  18. data/docs/Helium/DeviceConfiguration.html +476 -0
  19. data/docs/Helium/Element.html +203 -43
  20. data/docs/Helium/Error.html +15 -5
  21. data/docs/Helium/InvalidApiKey.html +3 -3
  22. data/docs/Helium/Label.html +35 -36
  23. data/docs/Helium/Metadata.html +589 -0
  24. data/docs/Helium/Organization.html +236 -17
  25. data/docs/Helium/Resource.html +655 -161
  26. data/docs/Helium/Sensor.html +345 -111
  27. data/docs/Helium/Timeseries.html +354 -0
  28. data/docs/Helium/User.html +161 -18
  29. data/docs/Helium/Utils.html +56 -4
  30. data/docs/_index.html +72 -7
  31. data/docs/class_list.html +1 -1
  32. data/docs/css/style.css +8 -1
  33. data/docs/file.README.html +66 -6
  34. data/docs/frames.html +1 -1
  35. data/docs/index.html +66 -6
  36. data/docs/method_list.html +619 -139
  37. data/docs/top-level-namespace.html +3 -3
  38. data/lib/helium.rb +2 -0
  39. data/lib/helium/client/configurations.rb +0 -12
  40. data/lib/helium/client/elements.rb +0 -12
  41. data/lib/helium/client/labels.rb +1 -12
  42. data/lib/helium/client/organizations.rb +1 -47
  43. data/lib/helium/client/sensors.rb +0 -12
  44. data/lib/helium/client/users.rb +1 -3
  45. data/lib/helium/collection.rb +129 -0
  46. data/lib/helium/configuration.rb +5 -1
  47. data/lib/helium/element.rb +1 -1
  48. data/lib/helium/label.rb +1 -3
  49. data/lib/helium/metadata.rb +58 -0
  50. data/lib/helium/organization.rb +4 -4
  51. data/lib/helium/resource.rb +28 -29
  52. data/lib/helium/sensor.rb +1 -1
  53. data/lib/helium/version.rb +1 -1
  54. metadata +11 -2
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Helium::Client::Organizations
8
8
 
9
- &mdash; Documentation by YARD 0.9.3
9
+ &mdash; Documentation by YARD 0.9.5
10
10
 
11
11
  </title>
12
12
 
@@ -122,28 +122,6 @@
122
122
 
123
123
 
124
124
 
125
- <span class="summary_desc"><div class='inline'></div></span>
126
-
127
- </li>
128
-
129
-
130
- <li class="public ">
131
- <span class="summary_signature">
132
-
133
- <a href="#organization_users-instance_method" title="#organization_users (instance method)">#<strong>organization_users</strong> &#x21d2; Object </a>
134
-
135
-
136
-
137
- </span>
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
125
  <span class="summary_desc"><div class='inline'></div></span>
148
126
 
149
127
  </li>
@@ -175,61 +153,13 @@
175
153
 
176
154
  4
177
155
  5
178
- 6
179
- 7
180
- 8</pre>
156
+ 6</pre>
181
157
  </td>
182
158
  <td>
183
159
  <pre class="code"><span class="info file"># File 'lib/helium/client/organizations.rb', line 4</span>
184
160
 
185
161
  <span class='kw'>def</span> <span class='id identifier rubyid_organization'>organization</span>
186
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/organization</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
187
- <span class='id identifier rubyid_org_data'>org_data</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='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'>&quot;</span><span class='tstring_content'>data</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
188
- <span class='kw'>return</span> <span class='const'>Organization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>client:</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='id identifier rubyid_org_data'>org_data</span><span class='rparen'>)</span>
189
- <span class='kw'>end</span></pre>
190
- </td>
191
- </tr>
192
- </table>
193
- </div>
194
-
195
- <div class="method_details ">
196
- <h3 class="signature " id="organization_users-instance_method">
197
-
198
- #<strong>organization_users</strong> &#x21d2; <tt>Object</tt>
199
-
200
-
201
-
202
-
203
-
204
- </h3><table class="source_code">
205
- <tr>
206
- <td>
207
- <pre class="lines">
208
-
209
-
210
- 10
211
- 11
212
- 12
213
- 13
214
- 14
215
- 15
216
- 16
217
- 17
218
- 18
219
- 19</pre>
220
- </td>
221
- <td>
222
- <pre class="code"><span class="info file"># File 'lib/helium/client/organizations.rb', line 10</span>
223
-
224
- <span class='kw'>def</span> <span class='id identifier rubyid_organization_users'>organization_users</span>
225
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/organization/user</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
226
- <span class='id identifier rubyid_users_data'>users_data</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='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'>&quot;</span><span class='tstring_content'>data</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
227
-
228
- <span class='id identifier rubyid_users'>users</span> <span class='op'>=</span> <span class='id identifier rubyid_users_data'>users_data</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_user_data'>user_data</span><span class='op'>|</span>
229
- <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>client:</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='id identifier rubyid_user_data'>user_data</span><span class='rparen'>)</span>
230
- <span class='kw'>end</span>
231
-
232
- <span class='kw'>return</span> <span class='id identifier rubyid_users'>users</span>
162
+ <span class='const'>Organization</span><span class='period'>.</span><span class='id identifier rubyid_singleton'>singleton</span><span class='lparen'>(</span><span class='label'>client:</span> <span class='kw'>self</span><span class='rparen'>)</span>
233
163
  <span class='kw'>end</span></pre>
234
164
  </td>
235
165
  </tr>
@@ -241,9 +171,9 @@
241
171
  </div>
242
172
 
243
173
  <div id="footer">
244
- Generated on Thu Sep 1 16:28:30 2016 by
174
+ Generated on Thu Jan 12 15:58:34 2017 by
245
175
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
246
- 0.9.3 (ruby-2.3.1).
176
+ 0.9.5 (ruby-2.3.1).
247
177
  </div>
248
178
 
249
179
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Helium::Client::Sensors
8
8
 
9
- &mdash; Documentation by YARD 0.9.3
9
+ &mdash; Documentation by YARD 0.9.5
10
10
 
11
11
  </title>
12
12
 
@@ -144,6 +144,50 @@
144
144
 
145
145
 
146
146
 
147
+ <span class="summary_desc"><div class='inline'></div></span>
148
+
149
+ </li>
150
+
151
+
152
+ <li class="public ">
153
+ <span class="summary_signature">
154
+
155
+ <a href="#sensor_device_configuration-instance_method" title="#sensor_device_configuration (instance method)">#<strong>sensor_device_configuration</strong>(sensor) &#x21d2; Object </a>
156
+
157
+
158
+
159
+ </span>
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+ <span class="summary_desc"><div class='inline'></div></span>
170
+
171
+ </li>
172
+
173
+
174
+ <li class="public ">
175
+ <span class="summary_signature">
176
+
177
+ <a href="#sensor_element-instance_method" title="#sensor_element (instance method)">#<strong>sensor_element</strong>(sensor) &#x21d2; Object </a>
178
+
179
+
180
+
181
+ </span>
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
147
191
  <span class="summary_desc"><div class='inline'></div></span>
148
192
 
149
193
  </li>
@@ -217,12 +261,12 @@
217
261
  <pre class="lines">
218
262
 
219
263
 
220
- 27
221
- 28
222
- 29</pre>
264
+ 48
265
+ 49
266
+ 50</pre>
223
267
  </td>
224
268
  <td>
225
- <pre class="code"><span class="info file"># File 'lib/helium/client/sensors.rb', line 27</span>
269
+ <pre class="code"><span class="info file"># File 'lib/helium/client/sensors.rb', line 48</span>
226
270
 
227
271
  <span class='kw'>def</span> <span class='id identifier rubyid_create_sensor'>create_sensor</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span><span class='rparen'>)</span>
228
272
  <span class='const'>Sensor</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span><span class='comma'>,</span> <span class='label'>client:</span> <span class='kw'>self</span><span class='rparen'>)</span>
@@ -263,9 +307,47 @@
263
307
  </div>
264
308
 
265
309
  <div class="method_details ">
266
- <h3 class="signature " id="sensor_timeseries-instance_method">
310
+ <h3 class="signature " id="sensor_device_configuration-instance_method">
267
311
 
268
- #<strong>sensor_timeseries</strong>(sensor, opts = {}) &#x21d2; <tt>Object</tt>
312
+ #<strong>sensor_device_configuration</strong>(sensor) &#x21d2; <tt>Object</tt>
313
+
314
+
315
+
316
+
317
+
318
+ </h3><table class="source_code">
319
+ <tr>
320
+ <td>
321
+ <pre class="lines">
322
+
323
+
324
+ 21
325
+ 22
326
+ 23
327
+ 24
328
+ 25
329
+ 26
330
+ 27</pre>
331
+ </td>
332
+ <td>
333
+ <pre class="code"><span class="info file"># File 'lib/helium/client/sensors.rb', line 21</span>
334
+
335
+ <span class='kw'>def</span> <span class='id identifier rubyid_sensor_device_configuration'>sensor_device_configuration</span><span class='lparen'>(</span><span class='id identifier rubyid_sensor'>sensor</span><span class='rparen'>)</span>
336
+ <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/sensor/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sensor'>sensor</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/device-configuration</span><span class='tstring_end'>&quot;</span></span>
337
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
338
+ <span class='id identifier rubyid_dc_data'>dc_data</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='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'>&quot;</span><span class='tstring_content'>data</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
339
+ <span class='comment'># dc_data is an array, but there will only be one for one
340
+ </span> <span class='kw'>return</span> <span class='const'>DeviceConfiguration</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>client:</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='id identifier rubyid_dc_data'>dc_data</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
341
+ <span class='kw'>end</span></pre>
342
+ </td>
343
+ </tr>
344
+ </table>
345
+ </div>
346
+
347
+ <div class="method_details ">
348
+ <h3 class="signature " id="sensor_element-instance_method">
349
+
350
+ #<strong>sensor_element</strong>(sensor) &#x21d2; <tt>Object</tt>
269
351
 
270
352
 
271
353
 
@@ -284,17 +366,61 @@
284
366
  16
285
367
  17
286
368
  18
287
- 19
288
- 20
289
- 21
290
- 22
291
- 23
292
- 24
293
- 25</pre>
369
+ 19</pre>
294
370
  </td>
295
371
  <td>
296
372
  <pre class="code"><span class="info file"># File 'lib/helium/client/sensors.rb', line 12</span>
297
373
 
374
+ <span class='kw'>def</span> <span class='id identifier rubyid_sensor_element'>sensor_element</span><span class='lparen'>(</span><span class='id identifier rubyid_sensor'>sensor</span><span class='rparen'>)</span>
375
+ <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/sensor/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sensor'>sensor</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/element</span><span class='tstring_end'>&quot;</span></span>
376
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
377
+ <span class='id identifier rubyid_elementj'>elementj</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='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'>&quot;</span><span class='tstring_content'>data</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
378
+ <span class='id identifier rubyid_element'>element</span> <span class='op'>=</span> <span class='const'>Element</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>client:</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='id identifier rubyid_elementj'>elementj</span><span class='rparen'>)</span>
379
+
380
+ <span class='kw'>return</span> <span class='id identifier rubyid_element'>element</span>
381
+ <span class='kw'>end</span></pre>
382
+ </td>
383
+ </tr>
384
+ </table>
385
+ </div>
386
+
387
+ <div class="method_details ">
388
+ <h3 class="signature " id="sensor_timeseries-instance_method">
389
+
390
+ #<strong>sensor_timeseries</strong>(sensor, opts = {}) &#x21d2; <tt>Object</tt>
391
+
392
+
393
+
394
+
395
+
396
+ </h3><table class="source_code">
397
+ <tr>
398
+ <td>
399
+ <pre class="lines">
400
+
401
+
402
+ 29
403
+ 30
404
+ 31
405
+ 32
406
+ 33
407
+ 34
408
+ 35
409
+ 36
410
+ 37
411
+ 38
412
+ 39
413
+ 40
414
+ 41
415
+ 42
416
+ 43
417
+ 44
418
+ 45
419
+ 46</pre>
420
+ </td>
421
+ <td>
422
+ <pre class="code"><span class="info file"># File 'lib/helium/client/sensors.rb', line 29</span>
423
+
298
424
  <span class='kw'>def</span> <span class='id identifier rubyid_sensor_timeseries'>sensor_timeseries</span><span class='lparen'>(</span><span class='id identifier rubyid_sensor'>sensor</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>
299
425
  <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/sensor/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sensor'>sensor</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/timeseries</span><span class='tstring_end'>&quot;</span></span>
300
426
 
@@ -307,7 +433,11 @@
307
433
  <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>agg[size]</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</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='rparen'>)</span>
308
434
  <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid__key'>_key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='rbrace'>}</span>
309
435
 
310
- <span class='id identifier rubyid_paginated_get'>paginated_get</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>klass:</span> <span class='const'>Helium</span><span class='op'>::</span><span class='const'>DataPoint</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
436
+ <span class='id identifier rubyid_paginated_get'>paginated_get</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span>
437
+ <span class='label'>klass:</span> <span class='const'>Helium</span><span class='op'>::</span><span class='const'>DataPoint</span><span class='comma'>,</span>
438
+ <span class='label'>cursor_klass:</span> <span class='const'>Helium</span><span class='op'>::</span><span class='const'>Timeseries</span><span class='comma'>,</span>
439
+ <span class='label'>params:</span> <span class='id identifier rubyid_params'>params</span>
440
+ <span class='rparen'>)</span>
311
441
  <span class='kw'>end</span></pre>
312
442
  </td>
313
443
  </tr>
@@ -349,9 +479,9 @@
349
479
  </div>
350
480
 
351
481
  <div id="footer">
352
- Generated on Thu Sep 1 16:28:30 2016 by
482
+ Generated on Thu Jan 12 15:58:34 2017 by
353
483
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
354
- 0.9.3 (ruby-2.3.1).
484
+ 0.9.5 (ruby-2.3.1).
355
485
  </div>
356
486
 
357
487
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Helium::Client::Users
8
8
 
9
- &mdash; Documentation by YARD 0.9.3
9
+ &mdash; Documentation by YARD 0.9.5
10
10
 
11
11
  </title>
12
12
 
@@ -153,17 +153,13 @@
153
153
 
154
154
  4
155
155
  5
156
- 6
157
- 7
158
- 8</pre>
156
+ 6</pre>
159
157
  </td>
160
158
  <td>
161
159
  <pre class="code"><span class="info file"># File 'lib/helium/client/users.rb', line 4</span>
162
160
 
163
161
  <span class='kw'>def</span> <span class='id identifier rubyid_user'>user</span>
164
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/user</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
165
- <span class='id identifier rubyid_user_data'>user_data</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='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'>&quot;</span><span class='tstring_content'>data</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
166
- <span class='kw'>return</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>client:</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='id identifier rubyid_user_data'>user_data</span><span class='rparen'>)</span>
162
+ <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_singleton'>singleton</span><span class='lparen'>(</span><span class='label'>client:</span> <span class='kw'>self</span><span class='rparen'>)</span>
167
163
  <span class='kw'>end</span></pre>
168
164
  </td>
169
165
  </tr>
@@ -175,9 +171,9 @@
175
171
  </div>
176
172
 
177
173
  <div id="footer">
178
- Generated on Thu Sep 1 16:28:30 2016 by
174
+ Generated on Thu Jan 12 15:58:34 2017 by
179
175
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
180
- 0.9.3 (ruby-2.3.1).
176
+ 0.9.5 (ruby-2.3.1).
181
177
  </div>
182
178
 
183
179
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Helium::ClientError
8
8
 
9
- &mdash; Documentation by YARD 0.9.3
9
+ &mdash; Documentation by YARD 0.9.5
10
10
 
11
11
  </title>
12
12
 
@@ -143,9 +143,9 @@
143
143
  </div>
144
144
 
145
145
  <div id="footer">
146
- Generated on Thu Sep 1 16:28:30 2016 by
146
+ Generated on Thu Jan 12 15:58:34 2017 by
147
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
148
- 0.9.3 (ruby-2.3.1).
148
+ 0.9.5 (ruby-2.3.1).
149
149
  </div>
150
150
 
151
151
  </div>
@@ -0,0 +1,1053 @@
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: Helium::Collection
8
+
9
+ &mdash; 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 = "Helium::Collection";
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 (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Helium.html" title="Helium (module)">Helium</a></span></span>
41
+ &raquo;
42
+ <span class="title">Collection</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: Helium::Collection
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">Helium::Collection</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+ <dl>
93
+ <dt>Includes:</dt>
94
+ <dd>Enumerable</dd>
95
+ </dl>
96
+
97
+
98
+
99
+
100
+
101
+
102
+ <dl>
103
+ <dt>Defined in:</dt>
104
+ <dd>lib/helium/collection.rb</dd>
105
+ </dl>
106
+
107
+ </div>
108
+
109
+
110
+
111
+
112
+
113
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
114
+ <ul class="summary">
115
+
116
+ <li class="public ">
117
+ <span class="summary_signature">
118
+
119
+ <a href="#filter_criteria-instance_method" title="#filter_criteria (instance method)">#<strong>filter_criteria</strong> &#x21d2; Object </a>
120
+
121
+
122
+
123
+ </span>
124
+
125
+
126
+
127
+
128
+ <span class="note title readonly">readonly</span>
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute filter_criteria.</p>
139
+ </div></span>
140
+
141
+ </li>
142
+
143
+
144
+ </ul>
145
+
146
+
147
+
148
+
149
+
150
+ <h2>
151
+ Instance Method Summary
152
+ <small><a href="#" class="summary_toggle">collapse</a></small>
153
+ </h2>
154
+
155
+ <ul class="summary">
156
+
157
+ <li class="public ">
158
+ <span class="summary_signature">
159
+
160
+ <a href="#%2B-instance_method" title="#+ (instance method)">#<strong>+</strong>(other) &#x21d2; Object </a>
161
+
162
+
163
+
164
+ </span>
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+ <span class="summary_desc"><div class='inline'><p>TODO: could support something like label.sensors &lt;&lt; new_sensor see Label#add_sensors for where it would be applied.</p>
175
+ </div></span>
176
+
177
+ </li>
178
+
179
+
180
+ <li class="public ">
181
+ <span class="summary_signature">
182
+
183
+ <a href="#--instance_method" title="#- (instance method)">#<strong>-</strong>(other) &#x21d2; Object </a>
184
+
185
+
186
+
187
+ </span>
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <span class="summary_desc"><div class='inline'></div></span>
198
+
199
+ </li>
200
+
201
+
202
+ <li class="public ">
203
+ <span class="summary_signature">
204
+
205
+ <a href="#%3D%3D-instance_method" title="#== (instance method)">#<strong>==</strong>(other) &#x21d2; Object </a>
206
+
207
+
208
+
209
+ </span>
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+ <span class="summary_desc"><div class='inline'><p>Collections are considered equal if they contain the same resources as determined by the resources&#39; ids.</p>
220
+ </div></span>
221
+
222
+ </li>
223
+
224
+
225
+ <li class="public ">
226
+ <span class="summary_signature">
227
+
228
+ <a href="#%5B%5D-instance_method" title="#[] (instance method)">#<strong>[]</strong>(index) &#x21d2; Object </a>
229
+
230
+
231
+
232
+ </span>
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+ <span class="summary_desc"><div class='inline'></div></span>
243
+
244
+ </li>
245
+
246
+
247
+ <li class="public ">
248
+ <span class="summary_signature">
249
+
250
+ <a href="#all-instance_method" title="#all (instance method)">#<strong>all</strong> &#x21d2; Helium::Collection </a>
251
+
252
+
253
+
254
+ </span>
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+ <span class="summary_desc"><div class='inline'><p>Returns all resources.</p>
265
+ </div></span>
266
+
267
+ </li>
268
+
269
+
270
+ <li class="public ">
271
+ <span class="summary_signature">
272
+
273
+ <a href="#collection-instance_method" title="#collection (instance method)">#<strong>collection</strong> &#x21d2; Resource </a>
274
+
275
+
276
+
277
+ </span>
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+ <span class="summary_desc"><div class='inline'><p>Returns an array of the Resources belonging to the Collection.</p>
288
+ </div></span>
289
+
290
+ </li>
291
+
292
+
293
+ <li class="public ">
294
+ <span class="summary_signature">
295
+
296
+ <a href="#each-instance_method" title="#each (instance method)">#<strong>each</strong> &#x21d2; Object </a>
297
+
298
+
299
+
300
+ </span>
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+ <span class="summary_desc"><div class='inline'></div></span>
311
+
312
+ </li>
313
+
314
+
315
+ <li class="public ">
316
+ <span class="summary_signature">
317
+
318
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(opts) &#x21d2; Collection </a>
319
+
320
+
321
+
322
+ </span>
323
+
324
+
325
+ <span class="note title constructor">constructor</span>
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+ <span class="summary_desc"><div class='inline'><p>A new instance of Collection.</p>
335
+ </div></span>
336
+
337
+ </li>
338
+
339
+
340
+ <li class="public ">
341
+ <span class="summary_signature">
342
+
343
+ <a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> &#x21d2; Object </a>
344
+
345
+
346
+
347
+ </span>
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+ <span class="summary_desc"><div class='inline'></div></span>
358
+
359
+ </li>
360
+
361
+
362
+ <li class="public ">
363
+ <span class="summary_signature">
364
+
365
+ <a href="#last-instance_method" title="#last (instance method)">#<strong>last</strong> &#x21d2; Object </a>
366
+
367
+
368
+
369
+ </span>
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+ <span class="summary_desc"><div class='inline'><p>NOTE: if we implement pagination, we&#39;ll need to rethink this.</p>
380
+ </div></span>
381
+
382
+ </li>
383
+
384
+
385
+ <li class="public ">
386
+ <span class="summary_signature">
387
+
388
+ <a href="#to_json-instance_method" title="#to_json (instance method)">#<strong>to_json</strong>(*options) &#x21d2; Object </a>
389
+
390
+
391
+
392
+ </span>
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+ <span class="summary_desc"><div class='inline'></div></span>
403
+
404
+ </li>
405
+
406
+
407
+ <li class="public ">
408
+ <span class="summary_signature">
409
+
410
+ <a href="#where-instance_method" title="#where (instance method)">#<strong>where</strong>(criteria) &#x21d2; Collection </a>
411
+
412
+
413
+
414
+ </span>
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+ <span class="summary_desc"><div class='inline'><p>Uses metadata filtering (<a href="https://docs.helium.com/api/v1/metadata/index.html#filtering">https://docs.helium.com/api/v1/metadata/index.html#filtering</a>) to search for a collection of resources matching the search parameters.</p>
425
+ </div></span>
426
+
427
+ </li>
428
+
429
+
430
+ </ul>
431
+
432
+
433
+
434
+ <div id="constructor_details" class="method_details_list">
435
+ <h2>Constructor Details</h2>
436
+
437
+ <div class="method_details first">
438
+ <h3 class="signature first" id="initialize-instance_method">
439
+
440
+ #<strong>initialize</strong>(opts) &#x21d2; <tt><span class='object_link'><a href="" title="Helium::Collection (class)">Collection</a></span></tt>
441
+
442
+
443
+
444
+
445
+
446
+ </h3><div class="docstring">
447
+ <div class="discussion">
448
+ <p>Returns a new instance of Collection</p>
449
+
450
+
451
+ </div>
452
+ </div>
453
+ <div class="tags">
454
+
455
+
456
+ </div><table class="source_code">
457
+ <tr>
458
+ <td>
459
+ <pre class="lines">
460
+
461
+
462
+ 7
463
+ 8
464
+ 9
465
+ 10
466
+ 11
467
+ 12
468
+ 13</pre>
469
+ </td>
470
+ <td>
471
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 7</span>
472
+
473
+ <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='rparen'>)</span>
474
+ <span class='ivar'>@client</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'>:client</span><span class='rparen'>)</span>
475
+ <span class='ivar'>@klass</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'>:klass</span><span class='rparen'>)</span>
476
+ <span class='ivar'>@belongs_to</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'>:belongs_to</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
477
+
478
+ <span class='ivar'>@filter_criteria</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
479
+ <span class='kw'>end</span></pre>
480
+ </td>
481
+ </tr>
482
+ </table>
483
+ </div>
484
+
485
+ </div>
486
+
487
+ <div id="instance_attr_details" class="attr_details">
488
+ <h2>Instance Attribute Details</h2>
489
+
490
+
491
+ <span id=""></span>
492
+ <div class="method_details first">
493
+ <h3 class="signature first" id="filter_criteria-instance_method">
494
+
495
+ #<strong>filter_criteria</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
496
+
497
+
498
+
499
+
500
+
501
+ </h3><div class="docstring">
502
+ <div class="discussion">
503
+ <p>Returns the value of attribute filter_criteria</p>
504
+
505
+
506
+ </div>
507
+ </div>
508
+ <div class="tags">
509
+
510
+
511
+ </div><table class="source_code">
512
+ <tr>
513
+ <td>
514
+ <pre class="lines">
515
+
516
+
517
+ 5
518
+ 6
519
+ 7</pre>
520
+ </td>
521
+ <td>
522
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 5</span>
523
+
524
+ <span class='kw'>def</span> <span class='id identifier rubyid_filter_criteria'>filter_criteria</span>
525
+ <span class='ivar'>@filter_criteria</span>
526
+ <span class='kw'>end</span></pre>
527
+ </td>
528
+ </tr>
529
+ </table>
530
+ </div>
531
+
532
+ </div>
533
+
534
+
535
+ <div id="instance_method_details" class="method_details_list">
536
+ <h2>Instance Method Details</h2>
537
+
538
+
539
+ <div class="method_details first">
540
+ <h3 class="signature first" id="+-instance_method">
541
+
542
+ #<strong>+</strong>(other) &#x21d2; <tt>Object</tt>
543
+
544
+
545
+
546
+
547
+
548
+ </h3><div class="docstring">
549
+ <div class="discussion">
550
+ <p>TODO: could support something like label.sensors &lt;&lt; new_sensor
551
+ see Label#add_sensors for where it would be applied</p>
552
+
553
+
554
+ </div>
555
+ </div>
556
+ <div class="tags">
557
+
558
+
559
+ </div><table class="source_code">
560
+ <tr>
561
+ <td>
562
+ <pre class="lines">
563
+
564
+
565
+ 60
566
+ 61
567
+ 62</pre>
568
+ </td>
569
+ <td>
570
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 60</span>
571
+
572
+ <span class='kw'>def</span> <span class='op'>+</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
573
+ <span class='id identifier rubyid_collection'>collection</span> <span class='op'>+</span> <span class='id identifier rubyid_other'>other</span>
574
+ <span class='kw'>end</span></pre>
575
+ </td>
576
+ </tr>
577
+ </table>
578
+ </div>
579
+
580
+ <div class="method_details ">
581
+ <h3 class="signature " id="--instance_method">
582
+
583
+ #<strong>-</strong>(other) &#x21d2; <tt>Object</tt>
584
+
585
+
586
+
587
+
588
+
589
+ </h3><table class="source_code">
590
+ <tr>
591
+ <td>
592
+ <pre class="lines">
593
+
594
+
595
+ 64
596
+ 65
597
+ 66</pre>
598
+ </td>
599
+ <td>
600
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 64</span>
601
+
602
+ <span class='kw'>def</span> <span class='op'>-</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
603
+ <span class='id identifier rubyid_collection'>collection</span> <span class='op'>-</span> <span class='id identifier rubyid_other'>other</span>
604
+ <span class='kw'>end</span></pre>
605
+ </td>
606
+ </tr>
607
+ </table>
608
+ </div>
609
+
610
+ <div class="method_details ">
611
+ <h3 class="signature " id="==-instance_method">
612
+
613
+ #<strong>==</strong>(other) &#x21d2; <tt>Object</tt>
614
+
615
+
616
+
617
+
618
+
619
+ </h3><div class="docstring">
620
+ <div class="discussion">
621
+ <p>Collections are considered equal if they contain the same resources
622
+ as determined by the resources&#39; ids</p>
623
+
624
+
625
+ </div>
626
+ </div>
627
+ <div class="tags">
628
+
629
+
630
+ </div><table class="source_code">
631
+ <tr>
632
+ <td>
633
+ <pre class="lines">
634
+
635
+
636
+ 74
637
+ 75
638
+ 76</pre>
639
+ </td>
640
+ <td>
641
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 74</span>
642
+
643
+ <span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
644
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
645
+ <span class='kw'>end</span></pre>
646
+ </td>
647
+ </tr>
648
+ </table>
649
+ </div>
650
+
651
+ <div class="method_details ">
652
+ <h3 class="signature " id="[]-instance_method">
653
+
654
+ #<strong>[]</strong>(index) &#x21d2; <tt>Object</tt>
655
+
656
+
657
+
658
+
659
+
660
+ </h3><table class="source_code">
661
+ <tr>
662
+ <td>
663
+ <pre class="lines">
664
+
665
+
666
+ 68
667
+ 69
668
+ 70</pre>
669
+ </td>
670
+ <td>
671
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 68</span>
672
+
673
+ <span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span>
674
+ <span class='id identifier rubyid_collection'>collection</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span>
675
+ <span class='kw'>end</span></pre>
676
+ </td>
677
+ </tr>
678
+ </table>
679
+ </div>
680
+
681
+ <div class="method_details ">
682
+ <h3 class="signature " id="all-instance_method">
683
+
684
+ #<strong>all</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Helium::Collection (class)">Helium::Collection</a></span></tt>
685
+
686
+
687
+
688
+
689
+
690
+ </h3><div class="docstring">
691
+ <div class="discussion">
692
+ <p>Returns all resources</p>
693
+
694
+
695
+ </div>
696
+ </div>
697
+ <div class="tags">
698
+ <p class="tag_title">Parameters:</p>
699
+ <ul class="param">
700
+
701
+ <li>
702
+
703
+ <span class='name'>opts</span>
704
+
705
+
706
+ <span class='type'>(<tt>Hash</tt>)</span>
707
+
708
+
709
+
710
+ &mdash;
711
+ <div class='inline'><p>a customizable set of options</p>
712
+ </div>
713
+
714
+ </li>
715
+
716
+ </ul>
717
+
718
+
719
+
720
+ <p class="tag_title">Returns:</p>
721
+ <ul class="return">
722
+
723
+ <li>
724
+
725
+
726
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Helium::Collection (class)">Helium::Collection</a></span></tt>)</span>
727
+
728
+
729
+
730
+ &mdash;
731
+ <div class='inline'><p>a Collection of all of the given Resource</p>
732
+ </div>
733
+
734
+ </li>
735
+
736
+ </ul>
737
+
738
+ </div><table class="source_code">
739
+ <tr>
740
+ <td>
741
+ <pre class="lines">
742
+
743
+
744
+ 18
745
+ 19
746
+ 20
747
+ 21</pre>
748
+ </td>
749
+ <td>
750
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 18</span>
751
+
752
+ <span class='kw'>def</span> <span class='id identifier rubyid_all'>all</span>
753
+ <span class='ivar'>@filter_criteria</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
754
+ <span class='kw'>self</span>
755
+ <span class='kw'>end</span></pre>
756
+ </td>
757
+ </tr>
758
+ </table>
759
+ </div>
760
+
761
+ <div class="method_details ">
762
+ <h3 class="signature " id="collection-instance_method">
763
+
764
+ #<strong>collection</strong> &#x21d2; <tt><span class='object_link'><a href="Resource.html" title="Helium::Resource (class)">Resource</a></span></tt>
765
+
766
+
767
+
768
+
769
+
770
+ </h3><div class="docstring">
771
+ <div class="discussion">
772
+ <p>Returns an array of the Resources belonging to the Collection</p>
773
+
774
+
775
+ </div>
776
+ </div>
777
+ <div class="tags">
778
+
779
+ <p class="tag_title">Returns:</p>
780
+ <ul class="return">
781
+
782
+ <li>
783
+
784
+
785
+ <span class='type'>(<tt><span class='object_link'><a href="Resource.html" title="Helium::Resource (class)">Resource</a></span></tt>)</span>
786
+
787
+
788
+
789
+ </li>
790
+
791
+ </ul>
792
+
793
+ </div><table class="source_code">
794
+ <tr>
795
+ <td>
796
+ <pre class="lines">
797
+
798
+
799
+ 42
800
+ 43
801
+ 44</pre>
802
+ </td>
803
+ <td>
804
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 42</span>
805
+
806
+ <span class='kw'>def</span> <span class='id identifier rubyid_collection'>collection</span>
807
+ <span class='id identifier rubyid_fetch_collection'>fetch_collection</span>
808
+ <span class='kw'>end</span></pre>
809
+ </td>
810
+ </tr>
811
+ </table>
812
+ </div>
813
+
814
+ <div class="method_details ">
815
+ <h3 class="signature " id="each-instance_method">
816
+
817
+ #<strong>each</strong> &#x21d2; <tt>Object</tt>
818
+
819
+
820
+
821
+
822
+
823
+ </h3><table class="source_code">
824
+ <tr>
825
+ <td>
826
+ <pre class="lines">
827
+
828
+
829
+ 46
830
+ 47
831
+ 48</pre>
832
+ </td>
833
+ <td>
834
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 46</span>
835
+
836
+ <span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span>
837
+ <span class='id identifier rubyid_collection'>collection</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_element'>element</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_element'>element</span> <span class='rbrace'>}</span>
838
+ <span class='kw'>end</span></pre>
839
+ </td>
840
+ </tr>
841
+ </table>
842
+ </div>
843
+
844
+ <div class="method_details ">
845
+ <h3 class="signature " id="inspect-instance_method">
846
+
847
+ #<strong>inspect</strong> &#x21d2; <tt>Object</tt>
848
+
849
+
850
+
851
+
852
+
853
+ </h3><table class="source_code">
854
+ <tr>
855
+ <td>
856
+ <pre class="lines">
857
+
858
+
859
+ 50
860
+ 51
861
+ 52</pre>
862
+ </td>
863
+ <td>
864
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 50</span>
865
+
866
+ <span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
867
+ <span class='id identifier rubyid_collection'>collection</span>
868
+ <span class='kw'>end</span></pre>
869
+ </td>
870
+ </tr>
871
+ </table>
872
+ </div>
873
+
874
+ <div class="method_details ">
875
+ <h3 class="signature " id="last-instance_method">
876
+
877
+ #<strong>last</strong> &#x21d2; <tt>Object</tt>
878
+
879
+
880
+
881
+
882
+
883
+ </h3><div class="docstring">
884
+ <div class="discussion">
885
+ <p>NOTE: if we implement pagination, we&#39;ll need to rethink this</p>
886
+
887
+
888
+ </div>
889
+ </div>
890
+ <div class="tags">
891
+
892
+
893
+ </div><table class="source_code">
894
+ <tr>
895
+ <td>
896
+ <pre class="lines">
897
+
898
+
899
+ 79
900
+ 80
901
+ 81</pre>
902
+ </td>
903
+ <td>
904
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 79</span>
905
+
906
+ <span class='kw'>def</span> <span class='id identifier rubyid_last'>last</span>
907
+ <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span>
908
+ <span class='kw'>end</span></pre>
909
+ </td>
910
+ </tr>
911
+ </table>
912
+ </div>
913
+
914
+ <div class="method_details ">
915
+ <h3 class="signature " id="to_json-instance_method">
916
+
917
+ #<strong>to_json</strong>(*options) &#x21d2; <tt>Object</tt>
918
+
919
+
920
+
921
+
922
+
923
+ </h3><table class="source_code">
924
+ <tr>
925
+ <td>
926
+ <pre class="lines">
927
+
928
+
929
+ 54
930
+ 55
931
+ 56</pre>
932
+ </td>
933
+ <td>
934
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 54</span>
935
+
936
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
937
+ <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
938
+ <span class='kw'>end</span></pre>
939
+ </td>
940
+ </tr>
941
+ </table>
942
+ </div>
943
+
944
+ <div class="method_details ">
945
+ <h3 class="signature " id="where-instance_method">
946
+
947
+ #<strong>where</strong>(criteria) &#x21d2; <tt><span class='object_link'><a href="" title="Helium::Collection (class)">Collection</a></span></tt>
948
+
949
+
950
+
951
+
952
+
953
+ </h3><div class="docstring">
954
+ <div class="discussion">
955
+ <p>Uses metadata filtering
956
+ (<a href="https://docs.helium.com/api/v1/metadata/index.html#filtering">https://docs.helium.com/api/v1/metadata/index.html#filtering</a>)
957
+ to search for a collection of resources matching the search parameters</p>
958
+
959
+
960
+ </div>
961
+ </div>
962
+ <div class="tags">
963
+
964
+ <div class="examples">
965
+ <p class="tag_title">Examples:</p>
966
+
967
+
968
+ <p class="example_title"><div class='inline'><p>Search for sensors by location</p>
969
+ </div></p>
970
+
971
+ <pre class="example code"><code><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_sensors'>sensors</span><span class='period'>.</span><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='label'>location:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Building B</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; [Sensor, Sensor]</span></code></pre>
972
+
973
+
974
+ <p class="example_title"><div class='inline'><p>Search for multiple matching search parameters</p>
975
+ </div></p>
976
+
977
+ <pre class="example code"><code><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_sensors'>sensors</span><span class='period'>.</span><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='label'>departments:</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>it</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>engineering</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='comment'>#=&gt; [Sensor, Sensor]</span></code></pre>
978
+
979
+ </div>
980
+ <p class="tag_title">Parameters:</p>
981
+ <ul class="param">
982
+
983
+ <li>
984
+
985
+ <span class='name'>a</span>
986
+
987
+
988
+ <span class='type'>(<tt>Hash</tt>)</span>
989
+
990
+
991
+
992
+ &mdash;
993
+ <div class='inline'><p>set of search criteria</p>
994
+ </div>
995
+
996
+ </li>
997
+
998
+ </ul>
999
+
1000
+ <p class="tag_title">Returns:</p>
1001
+ <ul class="return">
1002
+
1003
+ <li>
1004
+
1005
+
1006
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Helium::Collection (class)">Collection</a></span></tt>)</span>
1007
+
1008
+
1009
+
1010
+ &mdash;
1011
+ <div class='inline'><p>a Collection of resources matching the provided search criteria</p>
1012
+ </div>
1013
+
1014
+ </li>
1015
+
1016
+ </ul>
1017
+
1018
+ </div><table class="source_code">
1019
+ <tr>
1020
+ <td>
1021
+ <pre class="lines">
1022
+
1023
+
1024
+ 35
1025
+ 36
1026
+ 37
1027
+ 38</pre>
1028
+ </td>
1029
+ <td>
1030
+ <pre class="code"><span class="info file"># File 'lib/helium/collection.rb', line 35</span>
1031
+
1032
+ <span class='kw'>def</span> <span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='id identifier rubyid_criteria'>criteria</span><span class='rparen'>)</span>
1033
+ <span class='id identifier rubyid_add_filter_criteria'>add_filter_criteria</span><span class='lparen'>(</span><span class='id identifier rubyid_criteria'>criteria</span><span class='rparen'>)</span>
1034
+ <span class='kw'>self</span>
1035
+ <span class='kw'>end</span></pre>
1036
+ </td>
1037
+ </tr>
1038
+ </table>
1039
+ </div>
1040
+
1041
+ </div>
1042
+
1043
+ </div>
1044
+
1045
+ <div id="footer">
1046
+ Generated on Thu Jan 12 15:58:35 2017 by
1047
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1048
+ 0.9.5 (ruby-2.3.1).
1049
+ </div>
1050
+
1051
+ </div>
1052
+ </body>
1053
+ </html>