helium-ruby 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/README.md +3 -3
- data/docs/Helium.html +4 -4
- data/docs/Helium/Client.html +9 -9
- data/docs/Helium/Client/Elements.html +8 -110
- data/docs/Helium/Client/Http.html +31 -33
- data/docs/Helium/Client/Labels.html +38 -218
- data/docs/Helium/Client/Organizations.html +1 -1
- data/docs/Helium/Client/Sensors.html +30 -214
- data/docs/Helium/Client/Users.html +1 -1
- data/docs/Helium/ClientError.html +153 -0
- data/docs/Helium/Cursor.html +8 -8
- data/docs/Helium/DataPoint.html +9 -9
- data/docs/Helium/Element.html +16 -79
- data/docs/Helium/Error.html +267 -0
- data/docs/Helium/InvalidApiKey.html +157 -0
- data/docs/Helium/Label.html +29 -133
- data/docs/Helium/Organization.html +8 -8
- data/docs/Helium/Resource.html +717 -43
- data/docs/Helium/Sensor.html +31 -132
- data/docs/Helium/User.html +8 -8
- data/docs/Helium/Utils.html +1 -1
- data/docs/_index.html +33 -4
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +4 -4
- data/docs/index.html +4 -4
- data/docs/method_list.html +112 -144
- data/docs/top-level-namespace.html +1 -1
- data/lib/helium.rb +1 -0
- data/lib/helium/client.rb +3 -3
- data/lib/helium/client/elements.rb +10 -27
- data/lib/helium/client/http.rb +38 -19
- data/lib/helium/client/labels.rb +7 -53
- data/lib/helium/client/sensors.rb +5 -54
- data/lib/helium/cursor.rb +6 -6
- data/lib/helium/data_point.rb +5 -5
- data/lib/helium/element.rb +7 -8
- data/lib/helium/error.rb +28 -0
- data/lib/helium/label.rb +3 -11
- data/lib/helium/organization.rb +4 -4
- data/lib/helium/resource.rb +103 -5
- data/lib/helium/sensor.rb +13 -15
- data/lib/helium/user.rb +4 -4
- data/lib/helium/version.rb +1 -1
- metadata +6 -2
@@ -175,7 +175,7 @@
|
|
175
175
|
</div>
|
176
176
|
|
177
177
|
<div id="footer">
|
178
|
-
Generated on
|
178
|
+
Generated on Wed Aug 24 13:22:50 2016 by
|
179
179
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
180
180
|
0.9.3 (ruby-2.3.1).
|
181
181
|
</div>
|
@@ -0,0 +1,153 @@
|
|
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
|
+
Exception: Helium::ClientError
|
8
|
+
|
9
|
+
— 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::ClientError";
|
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> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Helium.html" title="Helium (module)">Helium</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">ClientError</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>Exception: Helium::ClientError
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
74
|
+
<span class="inheritName"><span class='object_link'><a href="Error.html" title="Helium::Error (class)">Error</a></span></span>
|
75
|
+
|
76
|
+
<ul class="fullTree">
|
77
|
+
<li>Object</li>
|
78
|
+
|
79
|
+
<li class="next">StandardError</li>
|
80
|
+
|
81
|
+
<li class="next"><span class='object_link'><a href="Error.html" title="Helium::Error (class)">Error</a></span></li>
|
82
|
+
|
83
|
+
<li class="next">Helium::ClientError</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
</dl>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<dl>
|
102
|
+
<dt>Defined in:</dt>
|
103
|
+
<dd>lib/helium/error.rb</dd>
|
104
|
+
</dl>
|
105
|
+
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<h2>Overview</h2><div class="docstring">
|
109
|
+
<div class="discussion">
|
110
|
+
<p>Raised on errors in the 400-499 range</p>
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
<div class="tags">
|
116
|
+
|
117
|
+
|
118
|
+
</div><div id="subclasses">
|
119
|
+
<h2>Direct Known Subclasses</h2>
|
120
|
+
<p class="children"><span class='object_link'><a href="InvalidApiKey.html" title="Helium::InvalidApiKey (class)">InvalidApiKey</a></span></p>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<h2>Method Summary</h2>
|
137
|
+
|
138
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Error.html" title="Helium::Error (class)">Error</a></span></h3>
|
139
|
+
<p class="inherited"><span class='object_link'><a href="Error.html#from_response-class_method" title="Helium::Error.from_response (method)">from_response</a></span></p>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div id="footer">
|
146
|
+
Generated on Wed Aug 24 13:22:51 2016 by
|
147
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
148
|
+
0.9.3 (ruby-2.3.1).
|
149
|
+
</div>
|
150
|
+
|
151
|
+
</div>
|
152
|
+
</body>
|
153
|
+
</html>
|
data/docs/Helium/Cursor.html
CHANGED
@@ -146,7 +146,7 @@
|
|
146
146
|
<li class="public ">
|
147
147
|
<span class="summary_signature">
|
148
148
|
|
149
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(
|
149
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(opts = {}) ⇒ Cursor </a>
|
150
150
|
|
151
151
|
|
152
152
|
|
@@ -200,7 +200,7 @@
|
|
200
200
|
<div class="method_details first">
|
201
201
|
<h3 class="signature first" id="initialize-instance_method">
|
202
202
|
|
203
|
-
#<strong>initialize</strong>(
|
203
|
+
#<strong>initialize</strong>(opts = {}) ⇒ <tt><span class='object_link'><a href="" title="Helium::Cursor (class)">Cursor</a></span></tt>
|
204
204
|
|
205
205
|
|
206
206
|
|
@@ -236,11 +236,11 @@
|
|
236
236
|
<td>
|
237
237
|
<pre class="code"><span class="info file"># File 'lib/helium/cursor.rb', line 5</span>
|
238
238
|
|
239
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='
|
240
|
-
<span class='ivar'>@client</span> <span class='op'>=</span> <span class='id identifier
|
241
|
-
<span class='ivar'>@path</span> <span class='op'>=</span> <span class='id identifier
|
242
|
-
<span class='ivar'>@klass</span> <span class='op'>=</span> <span class='id identifier
|
243
|
-
<span class='ivar'>@params</span> <span class='op'>=</span> <span class='id identifier
|
239
|
+
<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>
|
240
|
+
<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>
|
241
|
+
<span class='ivar'>@path</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'>:path</span><span class='rparen'>)</span>
|
242
|
+
<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>
|
243
|
+
<span class='ivar'>@params</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'>:params</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
244
244
|
|
245
245
|
<span class='ivar'>@collection</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
246
246
|
<span class='ivar'>@next_link</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
@@ -347,7 +347,7 @@
|
|
347
347
|
</div>
|
348
348
|
|
349
349
|
<div id="footer">
|
350
|
-
Generated on
|
350
|
+
Generated on Wed Aug 24 13:22:51 2016 by
|
351
351
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
352
352
|
0.9.3 (ruby-2.3.1).
|
353
353
|
</div>
|
data/docs/Helium/DataPoint.html
CHANGED
@@ -281,7 +281,7 @@
|
|
281
281
|
<li class="public ">
|
282
282
|
<span class="summary_signature">
|
283
283
|
|
284
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(
|
284
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(opts = {}) ⇒ DataPoint </a>
|
285
285
|
|
286
286
|
|
287
287
|
|
@@ -360,14 +360,14 @@
|
|
360
360
|
|
361
361
|
|
362
362
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Resource.html" title="Helium::Resource (class)">Resource</a></span></h3>
|
363
|
-
<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#created_at-instance_method" title="Helium::Resource#created_at (method)">#created_at</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#hash-instance_method" title="Helium::Resource#hash (method)">#hash</a></span>, <span class='object_link'><a href="Resource.html#to_json-instance_method" title="Helium::Resource#to_json (method)">#to_json</a></span>, <span class='object_link'><a href="Resource.html#updated_at-instance_method" title="Helium::Resource#updated_at (method)">#updated_at</a></span></p>
|
363
|
+
<p class="inherited"><span class='object_link'><a href="Resource.html#%3D%3D-instance_method" title="Helium::Resource#== (method)">#==</a></span>, <span class='object_link'><a href="Resource.html#all-class_method" title="Helium::Resource.all (method)">all</a></span>, <span class='object_link'><a href="Resource.html#create-class_method" title="Helium::Resource.create (method)">create</a></span>, <span class='object_link'><a href="Resource.html#created_at-instance_method" title="Helium::Resource#created_at (method)">#created_at</a></span>, <span class='object_link'><a href="Resource.html#destroy-instance_method" title="Helium::Resource#destroy (method)">#destroy</a></span>, <span class='object_link'><a href="Resource.html#eql%3F-instance_method" title="Helium::Resource#eql? (method)">#eql?</a></span>, <span class='object_link'><a href="Resource.html#find-class_method" title="Helium::Resource.find (method)">find</a></span>, <span class='object_link'><a href="Resource.html#hash-instance_method" title="Helium::Resource#hash (method)">#hash</a></span>, <span class='object_link'><a href="Resource.html#to_json-instance_method" title="Helium::Resource#to_json (method)">#to_json</a></span>, <span class='object_link'><a href="Resource.html#update-instance_method" title="Helium::Resource#update (method)">#update</a></span>, <span class='object_link'><a href="Resource.html#updated_at-instance_method" title="Helium::Resource#updated_at (method)">#updated_at</a></span></p>
|
364
364
|
<div id="constructor_details" class="method_details_list">
|
365
365
|
<h2>Constructor Details</h2>
|
366
366
|
|
367
367
|
<div class="method_details first">
|
368
368
|
<h3 class="signature first" id="initialize-instance_method">
|
369
369
|
|
370
|
-
#<strong>initialize</strong>(
|
370
|
+
#<strong>initialize</strong>(opts = {}) ⇒ <tt><span class='object_link'><a href="" title="Helium::DataPoint (class)">DataPoint</a></span></tt>
|
371
371
|
|
372
372
|
|
373
373
|
|
@@ -400,12 +400,12 @@
|
|
400
400
|
<td>
|
401
401
|
<pre class="code"><span class="info file"># File 'lib/helium/data_point.rb', line 5</span>
|
402
402
|
|
403
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='
|
404
|
-
<span class='kw'>super</span><span class='lparen'>(</span><span class='
|
403
|
+
<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>
|
404
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
405
405
|
|
406
|
-
<span class='ivar'>@timestamp</span> <span class='op'>=</span> <span class='
|
407
|
-
<span class='ivar'>@value</span> <span class='op'>=</span> <span class='
|
408
|
-
<span class='ivar'>@port</span> <span class='op'>=</span> <span class='
|
406
|
+
<span class='ivar'>@timestamp</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'>timestamp</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
407
|
+
<span class='ivar'>@value</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'>value</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
408
|
+
<span class='ivar'>@port</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'>port</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
409
409
|
<span class='kw'>end</span></pre>
|
410
410
|
</td>
|
411
411
|
</tr>
|
@@ -759,7 +759,7 @@
|
|
759
759
|
</div>
|
760
760
|
|
761
761
|
<div id="footer">
|
762
|
-
Generated on
|
762
|
+
Generated on Wed Aug 24 13:22:51 2016 by
|
763
763
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
764
764
|
0.9.3 (ruby-2.3.1).
|
765
765
|
</div>
|
data/docs/Helium/Element.html
CHANGED
@@ -238,7 +238,7 @@
|
|
238
238
|
<li class="public ">
|
239
239
|
<span class="summary_signature">
|
240
240
|
|
241
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(
|
241
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(opts = {}) ⇒ Element </a>
|
242
242
|
|
243
243
|
|
244
244
|
|
@@ -257,29 +257,6 @@
|
|
257
257
|
<span class="summary_desc"><div class='inline'><p>A new instance of Element.</p>
|
258
258
|
</div></span>
|
259
259
|
|
260
|
-
</li>
|
261
|
-
|
262
|
-
|
263
|
-
<li class="public ">
|
264
|
-
<span class="summary_signature">
|
265
|
-
|
266
|
-
<a href="#update-instance_method" title="#update (instance method)">#<strong>update</strong>(name:) ⇒ Object </a>
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
</span>
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
<span class="summary_desc"><div class='inline'><p>TODO these kinds of methods should be generalized into a Resource object.</p>
|
281
|
-
</div></span>
|
282
|
-
|
283
260
|
</li>
|
284
261
|
|
285
262
|
|
@@ -296,14 +273,14 @@
|
|
296
273
|
|
297
274
|
|
298
275
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Resource.html" title="Helium::Resource (class)">Resource</a></span></h3>
|
299
|
-
<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#created_at-instance_method" title="Helium::Resource#created_at (method)">#created_at</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#hash-instance_method" title="Helium::Resource#hash (method)">#hash</a></span>, <span class='object_link'><a href="Resource.html#to_json-instance_method" title="Helium::Resource#to_json (method)">#to_json</a></span>, <span class='object_link'><a href="Resource.html#updated_at-instance_method" title="Helium::Resource#updated_at (method)">#updated_at</a></span></p>
|
276
|
+
<p class="inherited"><span class='object_link'><a href="Resource.html#%3D%3D-instance_method" title="Helium::Resource#== (method)">#==</a></span>, <span class='object_link'><a href="Resource.html#all-class_method" title="Helium::Resource.all (method)">all</a></span>, <span class='object_link'><a href="Resource.html#create-class_method" title="Helium::Resource.create (method)">create</a></span>, <span class='object_link'><a href="Resource.html#created_at-instance_method" title="Helium::Resource#created_at (method)">#created_at</a></span>, <span class='object_link'><a href="Resource.html#destroy-instance_method" title="Helium::Resource#destroy (method)">#destroy</a></span>, <span class='object_link'><a href="Resource.html#eql%3F-instance_method" title="Helium::Resource#eql? (method)">#eql?</a></span>, <span class='object_link'><a href="Resource.html#find-class_method" title="Helium::Resource.find (method)">find</a></span>, <span class='object_link'><a href="Resource.html#hash-instance_method" title="Helium::Resource#hash (method)">#hash</a></span>, <span class='object_link'><a href="Resource.html#to_json-instance_method" title="Helium::Resource#to_json (method)">#to_json</a></span>, <span class='object_link'><a href="Resource.html#update-instance_method" title="Helium::Resource#update (method)">#update</a></span>, <span class='object_link'><a href="Resource.html#updated_at-instance_method" title="Helium::Resource#updated_at (method)">#updated_at</a></span></p>
|
300
277
|
<div id="constructor_details" class="method_details_list">
|
301
278
|
<h2>Constructor Details</h2>
|
302
279
|
|
303
280
|
<div class="method_details first">
|
304
281
|
<h3 class="signature first" id="initialize-instance_method">
|
305
282
|
|
306
|
-
#<strong>initialize</strong>(
|
283
|
+
#<strong>initialize</strong>(opts = {}) ⇒ <tt><span class='object_link'><a href="" title="Helium::Element (class)">Element</a></span></tt>
|
307
284
|
|
308
285
|
|
309
286
|
|
@@ -336,12 +313,12 @@
|
|
336
313
|
<td>
|
337
314
|
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 5</span>
|
338
315
|
|
339
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='
|
340
|
-
<span class='kw'>super</span><span class='lparen'>(</span><span class='
|
316
|
+
<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>
|
317
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
341
318
|
|
342
|
-
<span class='ivar'>@name</span> <span class='op'>=</span> <span class='
|
343
|
-
<span class='ivar'>@mac</span> <span class='op'>=</span> <span class='
|
344
|
-
<span class='ivar'>@versions</span> <span class='op'>=</span> <span class='
|
319
|
+
<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>
|
320
|
+
<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>
|
321
|
+
<span class='ivar'>@versions</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'>versions</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
345
322
|
<span class='kw'>end</span></pre>
|
346
323
|
</td>
|
347
324
|
</tr>
|
@@ -511,16 +488,16 @@
|
|
511
488
|
<pre class="lines">
|
512
489
|
|
513
490
|
|
491
|
+
14
|
492
|
+
15
|
493
|
+
16
|
494
|
+
17
|
495
|
+
18
|
514
496
|
19
|
515
|
-
20
|
516
|
-
21
|
517
|
-
22
|
518
|
-
23
|
519
|
-
24
|
520
|
-
25</pre>
|
497
|
+
20</pre>
|
521
498
|
</td>
|
522
499
|
<td>
|
523
|
-
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line
|
500
|
+
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 14</span>
|
524
501
|
|
525
502
|
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
526
503
|
<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>
|
@@ -532,46 +509,6 @@
|
|
532
509
|
</td>
|
533
510
|
</tr>
|
534
511
|
</table>
|
535
|
-
</div>
|
536
|
-
|
537
|
-
<div class="method_details ">
|
538
|
-
<h3 class="signature " id="update-instance_method">
|
539
|
-
|
540
|
-
#<strong>update</strong>(name:) ⇒ <tt>Object</tt>
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
</h3><div class="docstring">
|
547
|
-
<div class="discussion">
|
548
|
-
<p>TODO these kinds of methods should be generalized into a Resource object</p>
|
549
|
-
|
550
|
-
|
551
|
-
</div>
|
552
|
-
</div>
|
553
|
-
<div class="tags">
|
554
|
-
|
555
|
-
|
556
|
-
</div><table class="source_code">
|
557
|
-
<tr>
|
558
|
-
<td>
|
559
|
-
<pre class="lines">
|
560
|
-
|
561
|
-
|
562
|
-
14
|
563
|
-
15
|
564
|
-
16</pre>
|
565
|
-
</td>
|
566
|
-
<td>
|
567
|
-
<pre class="code"><span class="info file"># File 'lib/helium/element.rb', line 14</span>
|
568
|
-
|
569
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='label'>name:</span><span class='rparen'>)</span>
|
570
|
-
<span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_update_element'>update_element</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
571
|
-
<span class='kw'>end</span></pre>
|
572
|
-
</td>
|
573
|
-
</tr>
|
574
|
-
</table>
|
575
512
|
</div>
|
576
513
|
|
577
514
|
</div>
|
@@ -579,7 +516,7 @@
|
|
579
516
|
</div>
|
580
517
|
|
581
518
|
<div id="footer">
|
582
|
-
Generated on
|
519
|
+
Generated on Wed Aug 24 13:22:51 2016 by
|
583
520
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
584
521
|
0.9.3 (ruby-2.3.1).
|
585
522
|
</div>
|
@@ -0,0 +1,267 @@
|
|
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
|
+
Exception: Helium::Error
|
8
|
+
|
9
|
+
— 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::Error";
|
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 (E)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Helium.html" title="Helium (module)">Helium</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Error</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>Exception: Helium::Error
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
74
|
+
<span class="inheritName">StandardError</span>
|
75
|
+
|
76
|
+
<ul class="fullTree">
|
77
|
+
<li>Object</li>
|
78
|
+
|
79
|
+
<li class="next">StandardError</li>
|
80
|
+
|
81
|
+
<li class="next">Helium::Error</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<dl>
|
100
|
+
<dt>Defined in:</dt>
|
101
|
+
<dd>lib/helium/error.rb</dd>
|
102
|
+
</dl>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
<p>Custom error class for rescuing from Helium API errors</p>
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
<div class="tags">
|
114
|
+
|
115
|
+
|
116
|
+
</div><div id="subclasses">
|
117
|
+
<h2>Direct Known Subclasses</h2>
|
118
|
+
<p class="children"><span class='object_link'><a href="ClientError.html" title="Helium::ClientError (class)">ClientError</a></span></p>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<h2>
|
129
|
+
Class Method Summary
|
130
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
131
|
+
</h2>
|
132
|
+
|
133
|
+
<ul class="summary">
|
134
|
+
|
135
|
+
<li class="public ">
|
136
|
+
<span class="summary_signature">
|
137
|
+
|
138
|
+
<a href="#from_response-class_method" title="from_response (class method)">.<strong>from_response</strong>(response) ⇒ Helium::Error </a>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
</span>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<span class="summary_desc"><div class='inline'><p>Returns the appropriate Helium::Error subclass based on status and response message.</p>
|
153
|
+
</div></span>
|
154
|
+
|
155
|
+
</li>
|
156
|
+
|
157
|
+
|
158
|
+
</ul>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
<div id="class_method_details" class="method_details_list">
|
165
|
+
<h2>Class Method Details</h2>
|
166
|
+
|
167
|
+
|
168
|
+
<div class="method_details first">
|
169
|
+
<h3 class="signature first" id="from_response-class_method">
|
170
|
+
|
171
|
+
.<strong>from_response</strong>(response) ⇒ <tt><span class='object_link'><a href="" title="Helium::Error (class)">Helium::Error</a></span></tt>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
</h3><div class="docstring">
|
178
|
+
<div class="discussion">
|
179
|
+
<p>Returns the appropriate Helium::Error subclass based on status and
|
180
|
+
response message</p>
|
181
|
+
|
182
|
+
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
<div class="tags">
|
186
|
+
<p class="tag_title">Parameters:</p>
|
187
|
+
<ul class="param">
|
188
|
+
|
189
|
+
<li>
|
190
|
+
|
191
|
+
<span class='name'>response</span>
|
192
|
+
|
193
|
+
|
194
|
+
<span class='type'>(<tt>Typhoeus::Response</tt>)</span>
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
</li>
|
199
|
+
|
200
|
+
</ul>
|
201
|
+
|
202
|
+
<p class="tag_title">Returns:</p>
|
203
|
+
<ul class="return">
|
204
|
+
|
205
|
+
<li>
|
206
|
+
|
207
|
+
|
208
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Helium::Error (class)">Helium::Error</a></span></tt>)</span>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</li>
|
213
|
+
|
214
|
+
</ul>
|
215
|
+
|
216
|
+
</div><table class="source_code">
|
217
|
+
<tr>
|
218
|
+
<td>
|
219
|
+
<pre class="lines">
|
220
|
+
|
221
|
+
|
222
|
+
10
|
223
|
+
11
|
224
|
+
12
|
225
|
+
13
|
226
|
+
14
|
227
|
+
15
|
228
|
+
16
|
229
|
+
17
|
230
|
+
18
|
231
|
+
19
|
232
|
+
20
|
233
|
+
21</pre>
|
234
|
+
</td>
|
235
|
+
<td>
|
236
|
+
<pre class="code"><span class="info file"># File 'lib/helium/error.rb', line 10</span>
|
237
|
+
|
238
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
239
|
+
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span>
|
240
|
+
<span class='id identifier rubyid_message'>message</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'>"</span><span class='tstring_content'>errors</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>detail</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
|
241
|
+
|
242
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='kw'>case</span> <span class='id identifier rubyid_status'>status</span>
|
243
|
+
<span class='kw'>when</span> <span class='int'>401</span> <span class='kw'>then</span> <span class='const'>Helium</span><span class='op'>::</span><span class='const'>InvalidApiKey</span>
|
244
|
+
<span class='kw'>else</span> <span class='kw'>self</span>
|
245
|
+
<span class='kw'>end</span>
|
246
|
+
|
247
|
+
<span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
248
|
+
<span class='kw'>end</span>
|
249
|
+
<span class='kw'>end</span></pre>
|
250
|
+
</td>
|
251
|
+
</tr>
|
252
|
+
</table>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
</div>
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
<div id="footer">
|
260
|
+
Generated on Wed Aug 24 13:22:51 2016 by
|
261
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
262
|
+
0.9.3 (ruby-2.3.1).
|
263
|
+
</div>
|
264
|
+
|
265
|
+
</div>
|
266
|
+
</body>
|
267
|
+
</html>
|