clx_api 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.yardopts +1 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +55 -0
  7. data/Rakefile +7 -0
  8. data/clx_api.gemspec +26 -0
  9. data/doc/CLX.html +305 -0
  10. data/doc/CLX/API.html +1491 -0
  11. data/doc/CLX/CLXAPIException.html +411 -0
  12. data/doc/CLX/CLXException.html +134 -0
  13. data/doc/CLX/HTTPAdapter.html +1294 -0
  14. data/doc/CLX/HTTPClient.html +1058 -0
  15. data/doc/ClxApi.html +141 -0
  16. data/doc/_index.html +161 -0
  17. data/doc/class_list.html +58 -0
  18. data/doc/css/common.css +1 -0
  19. data/doc/css/full_list.css +57 -0
  20. data/doc/css/style.css +339 -0
  21. data/doc/file.README.html +112 -0
  22. data/doc/file_list.html +60 -0
  23. data/doc/frames.html +26 -0
  24. data/doc/index.html +112 -0
  25. data/doc/js/app.js +219 -0
  26. data/doc/js/full_list.js +181 -0
  27. data/doc/js/jquery.js +4 -0
  28. data/doc/method_list.html +279 -0
  29. data/doc/top-level-namespace.html +112 -0
  30. data/examples/get_gateway_by_id.rb +16 -0
  31. data/examples/get_gateways.rb +18 -0
  32. data/examples/get_operator_by_id.rb +21 -0
  33. data/examples/get_operators.rb +23 -0
  34. data/examples/get_price_entries_by_gateway_id.rb +19 -0
  35. data/examples/get_price_entries_by_gateway_id_and_operator_id.rb +17 -0
  36. data/examples/get_price_entries_by_gateway_id_and_operator_id_and_date.rb +18 -0
  37. data/examples/readme.md +167 -0
  38. data/lib/clx_api.rb +35 -0
  39. data/lib/clx_api/api.rb +132 -0
  40. data/lib/clx_api/exceptions/clx_api_exception.rb +25 -0
  41. data/lib/clx_api/exceptions/clx_exception.rb +8 -0
  42. data/lib/clx_api/http_adapter.rb +129 -0
  43. data/lib/clx_api/http_client.rb +163 -0
  44. data/lib/clx_api/version.rb +4 -0
  45. data/test/adapter/test_adapter.rb +67 -0
  46. data/test/api_test.rb +306 -0
  47. data/test/http_adapter_test.rb +211 -0
  48. data/test/http_client_test.rb +173 -0
  49. data/test/test_helper.rb +7 -0
  50. metadata +168 -0
@@ -0,0 +1,411 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Exception: CLX::CLXAPIException
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
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
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!CLX/CLXAPIException.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../CLX.html" title="CLX (module)">CLX</a></span></span>
36
+ &raquo;
37
+ <span class="title">CLXAPIException</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Exception: CLX::CLXAPIException
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Exception</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Exception</li>
82
+
83
+ <li class="next">CLX::CLXAPIException</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/clx_api/exceptions/clx_api_exception.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>CLX Exception Class for API request errors</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
120
+ <ul class="summary">
121
+
122
+ <li class="public ">
123
+ <span class="summary_signature">
124
+
125
+ <a href="#clx_error_code-instance_method" title="#clx_error_code (instance method)">- (Object) <strong>clx_error_code</strong> </a>
126
+
127
+
128
+
129
+ </span>
130
+
131
+
132
+
133
+
134
+ <span class="note title readonly">readonly</span>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ <span class="summary_desc"><div class='inline'>
145
+ <p>Returns the value of attribute clx_error_code.</p>
146
+ </div></span>
147
+
148
+ </li>
149
+
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#clx_error_message-instance_method" title="#clx_error_message (instance method)">- (Object) <strong>clx_error_message</strong> </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+ <span class="note title readonly">readonly</span>
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ <span class="summary_desc"><div class='inline'>
174
+ <p>Returns the value of attribute clx_error_message.</p>
175
+ </div></span>
176
+
177
+ </li>
178
+
179
+
180
+ </ul>
181
+
182
+
183
+
184
+
185
+
186
+ <h2>
187
+ Instance Method Summary
188
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
189
+ </h2>
190
+
191
+ <ul class="summary">
192
+
193
+ <li class="public ">
194
+ <span class="summary_signature">
195
+
196
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (CLXAPIException) <strong>initialize</strong>(clx_error_message = nil, clx_error_code = nil) </a>
197
+
198
+
199
+
200
+ </span>
201
+
202
+
203
+ <span class="note title constructor">constructor</span>
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <span class="summary_desc"><div class='inline'>
213
+ <p>Initialize CLX Exception.</p>
214
+ </div></span>
215
+
216
+ </li>
217
+
218
+
219
+ </ul>
220
+
221
+
222
+
223
+ <div id="constructor_details" class="method_details_list">
224
+ <h2>Constructor Details</h2>
225
+
226
+ <div class="method_details first">
227
+ <h3 class="signature first" id="initialize-instance_method">
228
+
229
+ - (<tt><span class='object_link'><a href="" title="CLX::CLXAPIException (class)">CLXAPIException</a></span></tt>) <strong>initialize</strong>(clx_error_message = nil, clx_error_code = nil)
230
+
231
+
232
+
233
+
234
+
235
+ </h3><div class="docstring">
236
+ <div class="discussion">
237
+
238
+ <p>Initialize CLX Exception</p>
239
+
240
+
241
+ </div>
242
+ </div>
243
+ <div class="tags">
244
+
245
+ <div class="examples">
246
+ <p class="tag_title">Examples:</p>
247
+
248
+
249
+ <pre class="example code"><code><span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_http_adapter'>http_adapter</span><span class='period'>.</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'>operator/99999999</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#results in error from api
250
+ </span><span class='id identifier rubyid_raise'>raise</span> <span class='const'>CLXException</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span></code></pre>
251
+
252
+ </div>
253
+ <p class="tag_title">Parameters:</p>
254
+ <ul class="param">
255
+
256
+ <li>
257
+
258
+ <span class='name'>clx_error_message</span>
259
+
260
+
261
+ <span class='type'>(<tt>String</tt>)</span>
262
+
263
+
264
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
265
+
266
+
267
+ </li>
268
+
269
+ <li>
270
+
271
+ <span class='name'>clx_error_code</span>
272
+
273
+
274
+ <span class='type'>(<tt>Integer</tt>)</span>
275
+
276
+
277
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
278
+
279
+
280
+ </li>
281
+
282
+ </ul>
283
+
284
+
285
+ </div><table class="source_code">
286
+ <tr>
287
+ <td>
288
+ <pre class="lines">
289
+
290
+
291
+ 18
292
+ 19
293
+ 20
294
+ 21</pre>
295
+ </td>
296
+ <td>
297
+ <pre class="code"><span class="info file"># File 'lib/clx_api/exceptions/clx_api_exception.rb', line 18</span>
298
+
299
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_clx_error_message'>clx_error_message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_clx_error_code'>clx_error_code</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
300
+ <span class='ivar'>@clx_error_message</span> <span class='op'>=</span> <span class='id identifier rubyid_clx_error_message'>clx_error_message</span>
301
+ <span class='ivar'>@clx_error_code</span> <span class='op'>=</span> <span class='id identifier rubyid_clx_error_code'>clx_error_code</span>
302
+ <span class='kw'>end</span></pre>
303
+ </td>
304
+ </tr>
305
+ </table>
306
+ </div>
307
+
308
+ </div>
309
+
310
+ <div id="instance_attr_details" class="attr_details">
311
+ <h2>Instance Attribute Details</h2>
312
+
313
+
314
+ <span id=""></span>
315
+ <div class="method_details first">
316
+ <h3 class="signature first" id="clx_error_code-instance_method">
317
+
318
+ - (<tt>Object</tt>) <strong>clx_error_code</strong> <span class="extras">(readonly)</span>
319
+
320
+
321
+
322
+
323
+
324
+ </h3><div class="docstring">
325
+ <div class="discussion">
326
+
327
+ <p>Returns the value of attribute clx_error_code</p>
328
+
329
+
330
+ </div>
331
+ </div>
332
+ <div class="tags">
333
+
334
+
335
+ </div><table class="source_code">
336
+ <tr>
337
+ <td>
338
+ <pre class="lines">
339
+
340
+
341
+ 7
342
+ 8
343
+ 9</pre>
344
+ </td>
345
+ <td>
346
+ <pre class="code"><span class="info file"># File 'lib/clx_api/exceptions/clx_api_exception.rb', line 7</span>
347
+
348
+ <span class='kw'>def</span> <span class='id identifier rubyid_clx_error_code'>clx_error_code</span>
349
+ <span class='ivar'>@clx_error_code</span>
350
+ <span class='kw'>end</span></pre>
351
+ </td>
352
+ </tr>
353
+ </table>
354
+ </div>
355
+
356
+
357
+ <span id=""></span>
358
+ <div class="method_details ">
359
+ <h3 class="signature " id="clx_error_message-instance_method">
360
+
361
+ - (<tt>Object</tt>) <strong>clx_error_message</strong> <span class="extras">(readonly)</span>
362
+
363
+
364
+
365
+
366
+
367
+ </h3><div class="docstring">
368
+ <div class="discussion">
369
+
370
+ <p>Returns the value of attribute clx_error_message</p>
371
+
372
+
373
+ </div>
374
+ </div>
375
+ <div class="tags">
376
+
377
+
378
+ </div><table class="source_code">
379
+ <tr>
380
+ <td>
381
+ <pre class="lines">
382
+
383
+
384
+ 10
385
+ 11
386
+ 12</pre>
387
+ </td>
388
+ <td>
389
+ <pre class="code"><span class="info file"># File 'lib/clx_api/exceptions/clx_api_exception.rb', line 10</span>
390
+
391
+ <span class='kw'>def</span> <span class='id identifier rubyid_clx_error_message'>clx_error_message</span>
392
+ <span class='ivar'>@clx_error_message</span>
393
+ <span class='kw'>end</span></pre>
394
+ </td>
395
+ </tr>
396
+ </table>
397
+ </div>
398
+
399
+ </div>
400
+
401
+
402
+ </div>
403
+
404
+ <div id="footer">
405
+ Generated on Mon May 25 12:34:50 2015 by
406
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
407
+ 0.8.7.6 (ruby-2.1.5).
408
+ </div>
409
+
410
+ </body>
411
+ </html>
@@ -0,0 +1,134 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Exception: CLX::CLXException
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
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
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!CLX/CLXException.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../CLX.html" title="CLX (module)">CLX</a></span></span>
36
+ &raquo;
37
+ <span class="title">CLXException</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Exception: CLX::CLXException
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Exception</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Exception</li>
82
+
83
+ <li class="next">CLX::CLXException</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/clx_api/exceptions/clx_exception.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>CLX Generic Exception Class</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ </div>
126
+
127
+ <div id="footer">
128
+ Generated on Mon May 25 12:34:50 2015 by
129
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130
+ 0.8.7.6 (ruby-2.1.5).
131
+ </div>
132
+
133
+ </body>
134
+ </html>