helium-ruby 0.2.0 → 0.3.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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +31 -0
  3. data/.csslintrc +2 -0
  4. data/.eslintignore +1 -0
  5. data/.eslintrc +213 -0
  6. data/.gitignore +0 -1
  7. data/.rubocop.yml +1156 -0
  8. data/CONTRIBUTING.md +33 -0
  9. data/LICENSE.txt +23 -17
  10. data/README.md +58 -47
  11. data/Rakefile +14 -0
  12. data/bin/console +8 -0
  13. data/docs/Helium.html +131 -0
  14. data/docs/Helium/Client.html +493 -0
  15. data/docs/Helium/Client/Http.html +428 -0
  16. data/docs/Helium/Client/Organizations.html +251 -0
  17. data/docs/Helium/Client/Sensors.html +543 -0
  18. data/docs/Helium/Client/Users.html +185 -0
  19. data/docs/Helium/Cursor.html +305 -0
  20. data/docs/Helium/DataPoint.html +707 -0
  21. data/docs/Helium/Organization.html +632 -0
  22. data/docs/Helium/Sensor.html +820 -0
  23. data/docs/Helium/User.html +563 -0
  24. data/docs/Helium/Utils.html +183 -0
  25. data/docs/_index.html +226 -0
  26. data/docs/class_list.html +51 -0
  27. data/docs/css/common.css +1 -0
  28. data/docs/css/full_list.css +58 -0
  29. data/docs/css/style.css +474 -0
  30. data/docs/file.README.html +266 -0
  31. data/docs/file_list.html +56 -0
  32. data/docs/frames.html +17 -0
  33. data/docs/index.html +266 -0
  34. data/docs/js/app.js +243 -0
  35. data/docs/js/full_list.js +216 -0
  36. data/docs/js/jquery.js +4 -0
  37. data/docs/method_list.html +475 -0
  38. data/docs/top-level-namespace.html +112 -0
  39. data/helium-ruby.gemspec +2 -0
  40. data/lib/helium.rb +1 -1
  41. data/lib/helium/client.rb +0 -16
  42. data/lib/helium/client/http.rb +50 -9
  43. data/lib/helium/client/sensors.rb +51 -28
  44. data/lib/helium/cursor.rb +54 -0
  45. data/lib/helium/data_point.rb +3 -3
  46. data/lib/helium/sensor.rb +9 -0
  47. data/lib/helium/version.rb +1 -1
  48. metadata +63 -3
  49. data/lib/helium/timeseries.rb +0 -35
@@ -0,0 +1,33 @@
1
+ ## Contributing
2
+
3
+ We value contributions from the community and will do everything we can go get them reviewed in a timely fashion. If you have code to send our way or a bug to report:
4
+
5
+ * Contributing Code: If you have new code or a bug fix, fork this repo, create a logically-named branch, and submit a PR against this repo. Include a write up of the PR with details on what it does.
6
+
7
+ * Reporting Bugs: Open an issue against this repo with as much detail as you can. At the very least you'll include steps to reproduce the problem.
8
+
9
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant](http://contributor-covenant.org) Code of Conduct.
10
+
11
+ Above all, thank you for taking the time to be a part of the Helium community.
12
+
13
+ ## Submitting a Pull Request
14
+
15
+ 1. Check out [the Development section][development] in the README for instructions on setting up the project for local development.
16
+ 2. [Fork the repository.][fork]
17
+ 3. [Create a topic branch.][branch]
18
+ 4. Add specs for your unimplemented feature or bug fix.
19
+ 5. Run `rake spec`. If your specs pass, return to step 4.
20
+ 6. Implement your feature or bug fix.
21
+ 7. Run `rake spec`. If your specs fail, return to step 6.
22
+ 8. Run `open coverage/index.html`. If your changes are not completely covered
23
+ by your tests, return to step 4.
24
+ 9. Add documentation for your feature or bug fix.
25
+ 10. Run bundle exec rake doc:yard. If your changes are not 100% documented, go back to step 9.
26
+ 11. Add, commit, and push your changes. For documentation-only fixes, please
27
+ add "[ci skip]" to your commit message to avoid needless CI builds.
28
+ 12. [Submit a pull request.][pr]
29
+
30
+ [development]: https://github.com/helium/helium-ruby#development
31
+ [fork]: https://help.github.com/articles/fork-a-repo
32
+ [branch]: https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/
33
+ [pr]: https://help.github.com/articles/using-pull-requests
@@ -1,21 +1,27 @@
1
- The MIT License (MIT)
1
+ Copyright 2016 - Helium Systems, Inc.
2
2
 
3
- Copyright (c) 2016 Andrew Allen
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are met:
4
5
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
6
+ * Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
11
8
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
9
+ * Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
14
12
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
13
+ * Neither the name of the copyright holder nor the
14
+ names of its contributors may be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
+ POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -73,32 +73,60 @@ client.sensor("08bab58b-d095-4c7c-912c-1f8024d91d95")
73
73
  # => #<Helium::Sensor:0x007f89acdb1b58 @id="08bab58b-d095-4c7c-912c-1f8024d91d95", @name="Marc's Isotope", @mac="6081f9fffe00019b", @ports=["t", "b"], @created_at="2015-08-06T17:28:11.614107Z", @updated_at="2016-05-30T22:36:50.810716Z">
74
74
  ```
75
75
 
76
+ #### Create a Virtual Sensor
77
+ ```ruby
78
+ sensor = client.new_sensor(name: "A New Sensor")
79
+ # => #<Helium::Sensor:0x007f89acdb1b58 @id="08bab58b-d095-4c7c-912c-1f8024d91d95", @name="A New Sensor", @mac="6081f9fffe00019b", @ports=["t", "b"], @created_at="2015-08-06T17:28:11.614107Z", @updated_at="2016-05-30T22:36:50.810716Z">
80
+ ```
81
+
82
+ #### Update a Sensor
83
+ ```ruby
84
+ sensor.update(name: "An Updated Sensor")
85
+ # => #<Helium::Sensor:0x007f89acdb1b58 @id="08bab58b-d095-4c7c-912c-1f8024d91d95", @name="A New Sensor", @mac="6081f9fffe00019b", @ports=["t", "b"], @created_at="2015-08-06T17:28:11.614107Z", @updated_at="2016-05-30T22:36:50.810716Z">
86
+ ```
87
+
88
+ #### Delete a Sensor
89
+ ```ruby
90
+ sensor.destroy
91
+ # => true
92
+ ```
93
+
76
94
  ### Timeseries
77
95
 
78
96
  #### Get Timeseries data for a sensor
97
+
98
+ Timeseries data is paginated by the Helium API which by default, returns pages of 1000 data points. When you call `.timeseries` on a sensor, you get back a `Helium::Cursor` object, which is an `Enumerable` object that handles paging through this data automatically.
99
+
79
100
  ```ruby
80
101
  sensor = client.sensor("08bab58b-d095-4c7c-912c-1f8024d91d95")
81
- sensor.timeseries
82
- # => #<Helium::Timeseries:0x007ff9dd92efa8 @data_points=[#<Helium::DataPoint:0x007ff9dd92ee18 @id="a4107e78-f15e-4c31-aab3-497bbfe3e33c", @timestamp="2015-08-11T18:50:04Z", @value=-40.125, @port="t">, ...
102
+ timeseries = sensor.timeseries(port: 't', start_time: DateTime.parse('2016-08-01'), end_time: DateTime.parse('2016-08-16'))
103
+ # => #<Helium::Cursor:0x007f9b02a25798 @path="/sensor/aba370be-837d-4b41-bee5-686b0069d874/timeseries", @klass=Helium::DataPoint, @options={"page[size]"=>1000, "filter[port]"=>"t", "filter[start]"=>"2016-08-01T00:00:00Z", "filter[end]"=>"2016-08-16T00:00:00Z"}, @collection=[], @next_link=nil, @is_last=false>
83
104
  ```
84
105
 
85
106
  #### Working with data points
86
- A `Helium::Timeseries` is a collection of `Helium::DataPoint`s which can be accessed by calling `.data_points`, or iterated over using the usual `Object#Enumerable` methods:
107
+ A `Helium::Cursor` is a collection of `Helium::DataPoint`s which can iterated over using the usual `Object#Enumerable` methods:
87
108
 
88
109
  ```ruby
89
- sensor.timeseries.each do |data_point|
110
+ sensor = client.sensor("08bab58b-d095-4c7c-912c-1f8024d91d95")
111
+
112
+ sensor.timeseries.take(1000).each do |data_point|
90
113
  puts data_point.id
91
114
  puts data_point.timestamp
92
115
  puts data_point.value
93
116
  puts data_point.port
94
117
  end
118
+
119
+ sensor.timeseries.first
120
+ # => #<Helium::DataPoint:0x007f9b0407f340 @id="6c115c10-323e-4756-ae1c-fc69982eb397", @timestamp="2016-08-15T23:55:42.2Z", @value=22.590084, @port="t">
95
121
  ```
96
122
 
123
+ Since pagination happens automatically, **it's strongly recommended to define a start and end time,** otherwise enumerating over the collection may take a very long time.
124
+
97
125
  #### Filtering Timeseries data
98
126
  Timeseries data can be filtered by port type and start/end time:
99
127
 
100
128
  ```ruby
101
- sensor.timeseries.collect(&:port).uniq
129
+ sensor.timeseries.take(1000).collect(&:port).uniq
102
130
  # => [
103
131
  # [0] "b",
104
132
  # [1] "l",
@@ -109,12 +137,12 @@ sensor.timeseries.collect(&:port).uniq
109
137
  # [6] "m"
110
138
  # ]
111
139
 
112
- sensor.timeseries(port: 't').collect(&:port).uniq
140
+ sensor.timeseries(port: 't').take(1000).collect(&:port).uniq
113
141
  # => [
114
142
  # [0] "t"
115
143
  # ]
116
144
 
117
- sensor.timeseries(start_time: DateTime.parse("2016-08-01"), end_time: DateTime.parse("2016-08-02")).collect(&:timestamp)
145
+ sensor.timeseries(start_time: DateTime.parse("2016-08-01"), end_time: DateTime.parse("2016-08-02")).take(1000).collect(&:timestamp)
118
146
  # => [
119
147
  # [0] #<DateTime: 2016-08-01T23:55:29+00:00 ((2457602j,86129s,802000000n),+0s,2299161j)>,
120
148
  # [1] #<DateTime: 2016-08-01T23:55:29+00:00 ((2457602j,86129s,61000000n),+0s,2299161j)>,
@@ -123,55 +151,31 @@ sensor.timeseries(start_time: DateTime.parse("2016-08-01"), end_time: DateTime.p
123
151
  # [4] #<DateTime: 2016-08-01T23:54:45+00:00 ((2457602j,86085s,544000000n),+0s,2299161j)>,
124
152
  ```
125
153
 
126
- #### Paging through Timeseries data
127
- Timeseries data is paginated at the API level. By default, 1000 data points are returned. This amount can be increased up to 10,000:
128
-
129
- ```ruby
130
- sensor.timeseries(size: 10_000).length
131
- # => 10000
132
- ```
133
-
134
- The data points are sorted from most recent, to least recent. The `.previous` method on a `Helium::Timeseries` object will return a new `Helium::Timeseries` object with the previous page of Timeseries data. Similarly, the `.next` method on a `Helium::Timeseries` object will return the next page of timeseries data, if it exists. If not, it will return `false`.
135
-
136
- ```ruby
137
- timeseries = sensor.timeseries
138
- # => #<Helium::Timeseries:0x007ff9e10d2c48 @data_points=[#<Helium::DataPoint:0x007ff9e10d2568 @id="3595e562-c065-442e-a3af-c6f43ddb1500", @timestamp="2016-08-10T13:21:49.866Z", @value=27, @port="l">, ...
139
-
140
- previous_timeseries = timeseries.previous
141
- # => #<Helium::Timeseries:0x007ff9dc141008 @data_points=[#<Helium::DataPoint:0x007ff9dc140f68 @id="1e4062cf-361d-415e-8c05-cd04954424d1", @timestamp="2016-08-10T13:11:49.353Z", @value=99804.15, @port="p">, ...
142
-
143
- previous_timeseries.next
144
- # =>
145
- ```
146
-
147
- If no previous data exists, the `.previous` method will return `false`.
148
-
149
- ```ruby
150
- sensor.timeseries.previous
151
- # => false
152
- ```
153
-
154
154
  #### Timeseries Aggregations
155
155
 
156
156
  In addition to returning the raw data points, Helium can return timeseries data aggregated into buckets.
157
157
 
158
-
159
158
  For example, if you wanted to display a graph of a sensor's temperature min, max and average readings grouped by day, you could do the following:
160
159
 
161
160
  ```ruby
162
161
  data_points = sensor.timeseries(port: 't', aggtype: 'min,max,avg', aggsize: '1d')
163
- # => #<Helium::Timeseries:0x007fe7038c2d18 @data_points=[#<Helium::DataPoint:0x007fe7038c2c00 @client=<Helium::Client @debug=true>, @id="a93e47f4-2fb2-4336-84c0-20f83ee2988e", @timestamp="2016-08-16T00:00:00Z", @value={"max"=>22.579952, "avg"=>22.1155383392857, "min"=>21.774511}, @port="agg(t)">, ...
162
+ # => #<Helium::Cursor:0x007f9b0413a708 @path="/sensor/aba370be-837d-4b41-bee5-686b0069d874/timeseries", @klass=Helium::DataPoint, @options={"page[size]"=>1000, "filter[port]"=>"t", "agg[type]"=>"min,max,avg", "agg[size]"=>"1d"}, @collection=[], @next_link=nil, @is_last=false>
164
163
 
165
164
  data_points.first.min
166
- # => 21.774511
165
+ # => 21.47564
167
166
 
168
167
  data_points.first.max
169
- # => 22.579952
168
+ # => 24.145264
170
169
 
171
170
  data_points.first.avg
172
- # => 22.1155383392857
171
+ # => 22.2916633036437
173
172
  ```
174
173
 
174
+ A full list of aggregation types and sizes can be found here: https://docs.helium.com/docs/timeseries#aggregations.
175
+
176
+ ## Source Documentation
177
+ Documentation for the gem's source can be found here: https://helium.github.io/helium-ruby/
178
+
175
179
 
176
180
  ## Development
177
181
 
@@ -180,15 +184,22 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
180
184
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
181
185
 
182
186
  ### Roadmap
183
- - [X] Timeseries Aggregations
184
- - [ ] POST/PUT/DELETE users, orgs, sensors, timeseries
185
- - [ ] Ports
186
- - [ ] Labels
187
- - [ ] Elements
187
+
188
+ We're working toward a v1.0.0 release, which will represent a feature-complete implementation of the Helium API. You can check the progress here: https://github.com/helium/helium-ruby/milestone/1.
189
+
190
+ Until the v1.0.0 release, the functionality of this gem is subject to change. To prevent breaking changes, you should use the pessimistic version constraint operator (`~>`) in your Gemfile to lock your helium-ruby version to the current minor release. This will allow updates to patch versions.
188
191
 
189
192
  ## Contributing
190
193
 
191
- Bug reports and pull requests are welcome on GitHub at https://github.com/helium/helium-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
194
+ We value contributions from the community and will do everything we can go get them reviewed in a timely fashion. If you have code to send our way or a bug to report:
195
+
196
+ * Contributing Code: If you have new code or a bug fix, fork this repo, create a logically-named branch, and submit a PR against this repo. Include a write up of the PR with details on what it does.
197
+
198
+ * Reporting Bugs: Open an issue against this repo with as much detail as you can. At the very least you'll include steps to reproduce the problem.
199
+
200
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) Code of Conduct.
201
+
202
+ Above all, thank you for taking the time to be a part of the Helium community.
192
203
 
193
204
  ### Running specs with Guard
194
205
 
@@ -206,4 +217,4 @@ When you modify any of the files in `lib/`, all specs will run. When you modify
206
217
 
207
218
  ## License
208
219
 
209
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
220
+ The gem is available as open source under the terms of the [BSD License](https://github.com/helium/helium-ruby/blob/master/LICENSE.txt).
data/Rakefile CHANGED
@@ -3,4 +3,18 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
+ task :test => :spec
6
7
  task :default => :spec
8
+
9
+ namespace :doc do
10
+ begin
11
+ require 'yard'
12
+ YARD::Rake::YardocTask.new do |task|
13
+ task.options = [
14
+ '--output-dir', 'docs',
15
+ '--markup', 'markdown',
16
+ ]
17
+ end
18
+ rescue LoadError
19
+ end
20
+ end
@@ -10,6 +10,14 @@ class Object
10
10
  return nil if API_KEY.nil?
11
11
  @client ||= Helium::Client.new(api_key: API_KEY, debug: true)
12
12
  end
13
+
14
+ def sensor
15
+ client.sensor("aba370be-837d-4b41-bee5-686b0069d874")
16
+ end
17
+
18
+ def timeseries
19
+ sensor.timeseries(port: 't', start_time: DateTime.parse('2016-08-01'), end_time: DateTime.parse('2016-08-16'))
20
+ end
13
21
  end
14
22
 
15
23
  require "pry"
@@ -0,0 +1,131 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: Helium
8
+
9
+ &mdash; Documentation by YARD 0.9.3
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";
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 (H)</a> &raquo;
40
+
41
+
42
+ <span class="title">Helium</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>Module: Helium
65
+
66
+
67
+
68
+ </h1>
69
+ <div class="box_info">
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dl>
82
+ <dt>Defined in:</dt>
83
+ <dd>lib/helium.rb<span class="defines">,<br />
84
+ lib/helium/user.rb,<br /> lib/helium/utils.rb,<br /> lib/helium/sensor.rb,<br /> lib/helium/client.rb,<br /> lib/helium/cursor.rb,<br /> lib/helium/version.rb,<br /> lib/helium/data_point.rb,<br /> lib/helium/client/http.rb,<br /> lib/helium/organization.rb,<br /> lib/helium/client/users.rb,<br /> lib/helium/client/sensors.rb,<br /> lib/helium/client/organizations.rb</span>
85
+ </dd>
86
+ </dl>
87
+
88
+ </div>
89
+
90
+ <h2>Defined Under Namespace</h2>
91
+ <p class="children">
92
+
93
+
94
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Helium/Utils.html" title="Helium::Utils (module)">Utils</a></span>
95
+
96
+
97
+
98
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Helium/Client.html" title="Helium::Client (class)">Client</a></span>, <span class='object_link'><a href="Helium/Cursor.html" title="Helium::Cursor (class)">Cursor</a></span>, <span class='object_link'><a href="Helium/DataPoint.html" title="Helium::DataPoint (class)">DataPoint</a></span>, <span class='object_link'><a href="Helium/Organization.html" title="Helium::Organization (class)">Organization</a></span>, <span class='object_link'><a href="Helium/Sensor.html" title="Helium::Sensor (class)">Sensor</a></span>, <span class='object_link'><a href="Helium/User.html" title="Helium::User (class)">User</a></span>
99
+
100
+
101
+ </p>
102
+
103
+ <h2>Constant Summary</h2>
104
+ <dl class="constants">
105
+
106
+ <dt id="VERSION-constant" class="">VERSION =
107
+
108
+ </dt>
109
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.2.0</span><span class='tstring_end'>&quot;</span></span></pre></dd>
110
+
111
+ </dl>
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+ </div>
122
+
123
+ <div id="footer">
124
+ Generated on Thu Aug 18 10:50:33 2016 by
125
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
126
+ 0.9.3 (ruby-2.3.1).
127
+ </div>
128
+
129
+ </div>
130
+ </body>
131
+ </html>
@@ -0,0 +1,493 @@
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::Client
8
+
9
+ &mdash; Documentation by YARD 0.9.3
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::Client";
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">Client</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::Client
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::Client</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><span class='object_link'><a href="Client/Http.html" title="Helium::Client::Http (module)">Http</a></span>, <span class='object_link'><a href="Client/Organizations.html" title="Helium::Client::Organizations (module)">Organizations</a></span>, <span class='object_link'><a href="Client/Sensors.html" title="Helium::Client::Sensors (module)">Sensors</a></span>, <span class='object_link'><a href="Client/Users.html" title="Helium::Client::Users (module)">Users</a></span>, <span class='object_link'><a href="Utils.html" title="Helium::Utils (module)">Utils</a></span></dd>
95
+ </dl>
96
+
97
+
98
+
99
+
100
+
101
+
102
+ <dl>
103
+ <dt>Defined in:</dt>
104
+ <dd>lib/helium/client.rb<span class="defines">,<br />
105
+ lib/helium/client/http.rb,<br /> lib/helium/client/users.rb,<br /> lib/helium/client/sensors.rb,<br /> lib/helium/client/organizations.rb</span>
106
+ </dd>
107
+ </dl>
108
+
109
+ </div>
110
+
111
+ <h2>Defined Under Namespace</h2>
112
+ <p class="children">
113
+
114
+
115
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Client/Http.html" title="Helium::Client::Http (module)">Http</a></span>, <span class='object_link'><a href="Client/Organizations.html" title="Helium::Client::Organizations (module)">Organizations</a></span>, <span class='object_link'><a href="Client/Sensors.html" title="Helium::Client::Sensors (module)">Sensors</a></span>, <span class='object_link'><a href="Client/Users.html" title="Helium::Client::Users (module)">Users</a></span>
116
+
117
+
118
+
119
+
120
+ </p>
121
+
122
+
123
+
124
+ <h2>Constant Summary</h2>
125
+
126
+ <h3 class="inherited">Constants included
127
+ from <span class='object_link'><a href="Client/Http.html" title="Helium::Client::Http (module)">Http</a></span></h3>
128
+ <p class="inherited"><span class='object_link'><a href="Client/Http.html#API_VERSION-constant" title="Helium::Client::Http::API_VERSION (constant)">Http::API_VERSION</a></span>, <span class='object_link'><a href="Client/Http.html#BASE_HTTP_HEADERS-constant" title="Helium::Client::Http::BASE_HTTP_HEADERS (constant)">Http::BASE_HTTP_HEADERS</a></span>, <span class='object_link'><a href="Client/Http.html#HOST-constant" title="Helium::Client::Http::HOST (constant)">Http::HOST</a></span>, <span class='object_link'><a href="Client/Http.html#PROTOCOL-constant" title="Helium::Client::Http::PROTOCOL (constant)">Http::PROTOCOL</a></span></p>
129
+
130
+
131
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
132
+ <ul class="summary">
133
+
134
+ <li class="public ">
135
+ <span class="summary_signature">
136
+
137
+ <a href="#api_key-instance_method" title="#api_key (instance method)">#<strong>api_key</strong> &#x21d2; Object </a>
138
+
139
+
140
+
141
+ </span>
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute api_key.</p>
155
+ </div></span>
156
+
157
+ </li>
158
+
159
+
160
+ </ul>
161
+
162
+
163
+
164
+
165
+
166
+ <h2>
167
+ Instance Method Summary
168
+ <small><a href="#" class="summary_toggle">collapse</a></small>
169
+ </h2>
170
+
171
+ <ul class="summary">
172
+
173
+ <li class="public ">
174
+ <span class="summary_signature">
175
+
176
+ <a href="#debug%3F-instance_method" title="#debug? (instance method)">#<strong>debug?</strong> &#x21d2; Boolean </a>
177
+
178
+
179
+
180
+ </span>
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+ <span class="summary_desc"><div class='inline'></div></span>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(api_key:, debug: false) &#x21d2; Client </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+ <span class="note title constructor">constructor</span>
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+ <span class="summary_desc"><div class='inline'><p>A new instance of Client.</p>
215
+ </div></span>
216
+
217
+ </li>
218
+
219
+
220
+ <li class="public ">
221
+ <span class="summary_signature">
222
+
223
+ <a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> &#x21d2; Object </a>
224
+
225
+
226
+
227
+ </span>
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+ <span class="summary_desc"><div class='inline'></div></span>
238
+
239
+ </li>
240
+
241
+
242
+ </ul>
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Client/Sensors.html" title="Helium::Client::Sensors (module)">Sensors</a></span></h3>
255
+ <p class="inherited"><span class='object_link'><a href="Client/Sensors.html#delete_sensor-instance_method" title="Helium::Client::Sensors#delete_sensor (method)">#delete_sensor</a></span>, <span class='object_link'><a href="Client/Sensors.html#new_sensor-instance_method" title="Helium::Client::Sensors#new_sensor (method)">#new_sensor</a></span>, <span class='object_link'><a href="Client/Sensors.html#sensor-instance_method" title="Helium::Client::Sensors#sensor (method)">#sensor</a></span>, <span class='object_link'><a href="Client/Sensors.html#sensor_timeseries-instance_method" title="Helium::Client::Sensors#sensor_timeseries (method)">#sensor_timeseries</a></span>, <span class='object_link'><a href="Client/Sensors.html#sensors-instance_method" title="Helium::Client::Sensors#sensors (method)">#sensors</a></span>, <span class='object_link'><a href="Client/Sensors.html#update_sensor-instance_method" title="Helium::Client::Sensors#update_sensor (method)">#update_sensor</a></span></p>
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Client/Organizations.html" title="Helium::Client::Organizations (module)">Organizations</a></span></h3>
266
+ <p class="inherited"><span class='object_link'><a href="Client/Organizations.html#organization-instance_method" title="Helium::Client::Organizations#organization (method)">#organization</a></span>, <span class='object_link'><a href="Client/Organizations.html#organization_users-instance_method" title="Helium::Client::Organizations#organization_users (method)">#organization_users</a></span></p>
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Client/Users.html" title="Helium::Client::Users (module)">Users</a></span></h3>
277
+ <p class="inherited"><span class='object_link'><a href="Client/Users.html#user-instance_method" title="Helium::Client::Users#user (method)">#user</a></span></p>
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Client/Http.html" title="Helium::Client::Http (module)">Http</a></span></h3>
288
+ <p class="inherited"><span class='object_link'><a href="Client/Http.html#delete-instance_method" title="Helium::Client::Http#delete (method)">#delete</a></span>, <span class='object_link'><a href="Client/Http.html#get-instance_method" title="Helium::Client::Http#get (method)">#get</a></span>, <span class='object_link'><a href="Client/Http.html#paginated_get-instance_method" title="Helium::Client::Http#paginated_get (method)">#paginated_get</a></span>, <span class='object_link'><a href="Client/Http.html#patch-instance_method" title="Helium::Client::Http#patch (method)">#patch</a></span>, <span class='object_link'><a href="Client/Http.html#post-instance_method" title="Helium::Client::Http#post (method)">#post</a></span></p>
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Utils.html" title="Helium::Utils (module)">Utils</a></span></h3>
299
+ <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></p>
300
+ <div id="constructor_details" class="method_details_list">
301
+ <h2>Constructor Details</h2>
302
+
303
+ <div class="method_details first">
304
+ <h3 class="signature first" id="initialize-instance_method">
305
+
306
+ #<strong>initialize</strong>(api_key:, debug: false) &#x21d2; <tt><span class='object_link'><a href="" title="Helium::Client (class)">Client</a></span></tt>
307
+
308
+
309
+
310
+
311
+
312
+ </h3><div class="docstring">
313
+ <div class="discussion">
314
+ <p>Returns a new instance of Client</p>
315
+
316
+
317
+ </div>
318
+ </div>
319
+ <div class="tags">
320
+
321
+
322
+ </div><table class="source_code">
323
+ <tr>
324
+ <td>
325
+ <pre class="lines">
326
+
327
+
328
+ 16
329
+ 17
330
+ 18
331
+ 19</pre>
332
+ </td>
333
+ <td>
334
+ <pre class="code"><span class="info file"># File 'lib/helium/client.rb', line 16</span>
335
+
336
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>api_key:</span><span class='comma'>,</span> <span class='label'>debug:</span> <span class='kw'>false</span><span class='rparen'>)</span>
337
+ <span class='ivar'>@api_key</span> <span class='op'>=</span> <span class='id identifier rubyid_api_key'>api_key</span>
338
+ <span class='ivar'>@debug</span> <span class='op'>=</span> <span class='id identifier rubyid_debug'>debug</span>
339
+ <span class='kw'>end</span></pre>
340
+ </td>
341
+ </tr>
342
+ </table>
343
+ </div>
344
+
345
+ </div>
346
+
347
+ <div id="instance_attr_details" class="attr_details">
348
+ <h2>Instance Attribute Details</h2>
349
+
350
+
351
+ <span id="api_key=-instance_method"></span>
352
+ <div class="method_details first">
353
+ <h3 class="signature first" id="api_key-instance_method">
354
+
355
+ #<strong>api_key</strong> &#x21d2; <tt>Object</tt>
356
+
357
+
358
+
359
+
360
+
361
+ </h3><div class="docstring">
362
+ <div class="discussion">
363
+ <p>Returns the value of attribute api_key</p>
364
+
365
+
366
+ </div>
367
+ </div>
368
+ <div class="tags">
369
+
370
+
371
+ </div><table class="source_code">
372
+ <tr>
373
+ <td>
374
+ <pre class="lines">
375
+
376
+
377
+ 14
378
+ 15
379
+ 16</pre>
380
+ </td>
381
+ <td>
382
+ <pre class="code"><span class="info file"># File 'lib/helium/client.rb', line 14</span>
383
+
384
+ <span class='kw'>def</span> <span class='id identifier rubyid_api_key'>api_key</span>
385
+ <span class='ivar'>@api_key</span>
386
+ <span class='kw'>end</span></pre>
387
+ </td>
388
+ </tr>
389
+ </table>
390
+ </div>
391
+
392
+ </div>
393
+
394
+
395
+ <div id="instance_method_details" class="method_details_list">
396
+ <h2>Instance Method Details</h2>
397
+
398
+
399
+ <div class="method_details first">
400
+ <h3 class="signature first" id="debug?-instance_method">
401
+
402
+ #<strong>debug?</strong> &#x21d2; <tt>Boolean</tt>
403
+
404
+
405
+
406
+
407
+
408
+ </h3><div class="docstring">
409
+ <div class="discussion">
410
+
411
+
412
+ </div>
413
+ </div>
414
+ <div class="tags">
415
+
416
+ <p class="tag_title">Returns:</p>
417
+ <ul class="return">
418
+
419
+ <li>
420
+
421
+
422
+ <span class='type'>(<tt>Boolean</tt>)</span>
423
+
424
+
425
+
426
+ </li>
427
+
428
+ </ul>
429
+
430
+ </div><table class="source_code">
431
+ <tr>
432
+ <td>
433
+ <pre class="lines">
434
+
435
+
436
+ 25
437
+ 26
438
+ 27</pre>
439
+ </td>
440
+ <td>
441
+ <pre class="code"><span class="info file"># File 'lib/helium/client.rb', line 25</span>
442
+
443
+ <span class='kw'>def</span> <span class='id identifier rubyid_debug?'>debug?</span>
444
+ <span class='ivar'>@debug</span> <span class='op'>==</span> <span class='kw'>true</span>
445
+ <span class='kw'>end</span></pre>
446
+ </td>
447
+ </tr>
448
+ </table>
449
+ </div>
450
+
451
+ <div class="method_details ">
452
+ <h3 class="signature " id="inspect-instance_method">
453
+
454
+ #<strong>inspect</strong> &#x21d2; <tt>Object</tt>
455
+
456
+
457
+
458
+
459
+
460
+ </h3><table class="source_code">
461
+ <tr>
462
+ <td>
463
+ <pre class="lines">
464
+
465
+
466
+ 21
467
+ 22
468
+ 23</pre>
469
+ </td>
470
+ <td>
471
+ <pre class="code"><span class="info file"># File 'lib/helium/client.rb', line 21</span>
472
+
473
+ <span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
474
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;Helium::Client @debug=</span><span class='embexpr_beg'>#{</span><span class='ivar'>@debug</span><span class='embexpr_end'>}</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&quot;</span></span>
475
+ <span class='kw'>end</span></pre>
476
+ </td>
477
+ </tr>
478
+ </table>
479
+ </div>
480
+
481
+ </div>
482
+
483
+ </div>
484
+
485
+ <div id="footer">
486
+ Generated on Thu Aug 18 10:50:33 2016 by
487
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
488
+ 0.9.3 (ruby-2.3.1).
489
+ </div>
490
+
491
+ </div>
492
+ </body>
493
+ </html>