clx_api 0.1.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 (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
data/doc/CLX/API.html ADDED
@@ -0,0 +1,1491 @@
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
+ Class: CLX::API
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/API.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 (A)</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">API</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>Class: CLX::API
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">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">CLX::API</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/clx_api/api.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Library class for CLX Networks REST API</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
118
+ <ul class="summary">
119
+
120
+ <li class="public ">
121
+ <span class="summary_signature">
122
+
123
+ <a href="#http_client-instance_method" title="#http_client (instance method)">- (Object) <strong>http_client</strong> </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <span class="summary_desc"><div class='inline'>
141
+ <p>Mostly for testing.</p>
142
+ </div></span>
143
+
144
+ </li>
145
+
146
+
147
+ </ul>
148
+
149
+
150
+
151
+
152
+
153
+ <h2>
154
+ Instance Method Summary
155
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
156
+ </h2>
157
+
158
+ <ul class="summary">
159
+
160
+ <li class="public ">
161
+ <span class="summary_signature">
162
+
163
+ <a href="#get_gateway_by_id-instance_method" title="#get_gateway_by_id (instance method)">- (hash) <strong>get_gateway_by_id</strong>(gateway_id) </a>
164
+
165
+
166
+
167
+ </span>
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+ <span class="summary_desc"><div class='inline'>
178
+ <p>Get one gateway based on it&#39;s gateway id.</p>
179
+ </div></span>
180
+
181
+ </li>
182
+
183
+
184
+ <li class="public ">
185
+ <span class="summary_signature">
186
+
187
+ <a href="#get_gateways-instance_method" title="#get_gateways (instance method)">- (hash) <strong>get_gateways</strong> </a>
188
+
189
+
190
+
191
+ </span>
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+ <span class="summary_desc"><div class='inline'>
202
+ <p>Get all gateways.</p>
203
+ </div></span>
204
+
205
+ </li>
206
+
207
+
208
+ <li class="public ">
209
+ <span class="summary_signature">
210
+
211
+ <a href="#get_operator_by_id-instance_method" title="#get_operator_by_id (instance method)">- (hash) <strong>get_operator_by_id</strong>(operator_id) </a>
212
+
213
+
214
+
215
+ </span>
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+ <span class="summary_desc"><div class='inline'>
226
+ <p>Get one operator based on it&#39;s operator id.</p>
227
+ </div></span>
228
+
229
+ </li>
230
+
231
+
232
+ <li class="public ">
233
+ <span class="summary_signature">
234
+
235
+ <a href="#get_operators-instance_method" title="#get_operators (instance method)">- (hash) <strong>get_operators</strong> </a>
236
+
237
+
238
+
239
+ </span>
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+ <span class="summary_desc"><div class='inline'>
250
+ <p>Get all operators from the API.</p>
251
+ </div></span>
252
+
253
+ </li>
254
+
255
+
256
+ <li class="public ">
257
+ <span class="summary_signature">
258
+
259
+ <a href="#get_price_entires_by_gateway_id-instance_method" title="#get_price_entires_by_gateway_id (instance method)">- (hash) <strong>get_price_entires_by_gateway_id</strong>(gateway_id) </a>
260
+
261
+
262
+
263
+ </span>
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ <span class="summary_desc"><div class='inline'>
274
+ <p>Get price entires based on gateway id.</p>
275
+ </div></span>
276
+
277
+ </li>
278
+
279
+
280
+ <li class="public ">
281
+ <span class="summary_signature">
282
+
283
+ <a href="#get_price_entries_by_gateway_id_and_operator_id-instance_method" title="#get_price_entries_by_gateway_id_and_operator_id (instance method)">- (hash) <strong>get_price_entries_by_gateway_id_and_operator_id</strong>(gateway_id, operator_id) </a>
284
+
285
+
286
+
287
+ </span>
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+ <span class="summary_desc"><div class='inline'>
298
+ <p>Get price entiry based on gateway id and operator id.</p>
299
+ </div></span>
300
+
301
+ </li>
302
+
303
+
304
+ <li class="public ">
305
+ <span class="summary_signature">
306
+
307
+ <a href="#get_price_entries_by_gateway_id_and_operator_id_and_date-instance_method" title="#get_price_entries_by_gateway_id_and_operator_id_and_date (instance method)">- (hash) <strong>get_price_entries_by_gateway_id_and_operator_id_and_date</strong>(gateway_id, operator_id, date) </a>
308
+
309
+
310
+
311
+ </span>
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+ <span class="summary_desc"><div class='inline'>
322
+ <p>Get price entiry based on gateway id, operator id and a date.</p>
323
+ </div></span>
324
+
325
+ </li>
326
+
327
+
328
+ <li class="public ">
329
+ <span class="summary_signature">
330
+
331
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (CLX::API) <strong>initialize</strong>(username, password, http_adapter = nil) </a>
332
+
333
+
334
+
335
+ </span>
336
+
337
+
338
+ <span class="note title constructor">constructor</span>
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+ <span class="summary_desc"><div class='inline'>
348
+ <p>Initialize a new API client.</p>
349
+ </div></span>
350
+
351
+ </li>
352
+
353
+
354
+ <li class="public ">
355
+ <span class="summary_signature">
356
+
357
+ <a href="#set_auth-instance_method" title="#set_auth (instance method)">- (Object) <strong>set_auth</strong>(username, password) </a>
358
+
359
+
360
+
361
+ </span>
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+ <span class="summary_desc"><div class='inline'>
372
+ <p>Enables change of credentials after initialization.</p>
373
+ </div></span>
374
+
375
+ </li>
376
+
377
+
378
+ <li class="public ">
379
+ <span class="summary_signature">
380
+
381
+ <a href="#set_base_url-instance_method" title="#set_base_url (instance method)">- (Object) <strong>set_base_url</strong>(url) </a>
382
+
383
+
384
+
385
+ </span>
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+ <span class="summary_desc"><div class='inline'>
396
+ <p>Enables change of base URL after initialization.</p>
397
+ </div></span>
398
+
399
+ </li>
400
+
401
+
402
+ <li class="private ">
403
+ <span class="summary_signature">
404
+
405
+ <a href="#valid_date%3F-instance_method" title="#valid_date? (instance method)">- (Boolean) <strong>valid_date?</strong>(date) </a>
406
+
407
+
408
+
409
+ </span>
410
+
411
+
412
+
413
+ <span class="note title private">private</span>
414
+
415
+
416
+
417
+
418
+
419
+ <span class="summary_desc"><div class='inline'>
420
+ <p>Validates that date is of type DateTime.</p>
421
+ </div></span>
422
+
423
+ </li>
424
+
425
+
426
+ <li class="private ">
427
+ <span class="summary_signature">
428
+
429
+ <a href="#valid_id%3F-instance_method" title="#valid_id? (instance method)">- (Boolean) <strong>valid_id?</strong>(id) </a>
430
+
431
+
432
+
433
+ </span>
434
+
435
+
436
+
437
+ <span class="note title private">private</span>
438
+
439
+
440
+
441
+
442
+
443
+ <span class="summary_desc"><div class='inline'>
444
+ <p>Validates that in is of type integer and is grater than zero.</p>
445
+ </div></span>
446
+
447
+ </li>
448
+
449
+
450
+ </ul>
451
+
452
+
453
+ <div id="constructor_details" class="method_details_list">
454
+ <h2>Constructor Details</h2>
455
+
456
+ <div class="method_details first">
457
+ <h3 class="signature first" id="initialize-instance_method">
458
+
459
+ - (<tt><span class='object_link'><a href="" title="CLX::API (class)">CLX::API</a></span></tt>) <strong>initialize</strong>(username, password, http_adapter = nil)
460
+
461
+
462
+
463
+
464
+
465
+ </h3><div class="docstring">
466
+ <div class="discussion">
467
+
468
+ <p>Initialize a new API client</p>
469
+
470
+
471
+ </div>
472
+ </div>
473
+ <div class="tags">
474
+
475
+ <div class="examples">
476
+ <p class="tag_title">Examples:</p>
477
+
478
+
479
+ <pre class="example code"><code><span class='const'>CLX</span><span class='op'>::</span><span class='const'>API</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>my_username</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'>my_password</span><span class='tstring_end'>&#39;</span></span></code></pre>
480
+
481
+ </div>
482
+ <p class="tag_title">Parameters:</p>
483
+ <ul class="param">
484
+
485
+ <li>
486
+
487
+ <span class='name'>username</span>
488
+
489
+
490
+ <span class='type'>(<tt>String</tt>)</span>
491
+
492
+
493
+
494
+ </li>
495
+
496
+ <li>
497
+
498
+ <span class='name'>password</span>
499
+
500
+
501
+ <span class='type'>(<tt>String</tt>)</span>
502
+
503
+
504
+
505
+ </li>
506
+
507
+ <li>
508
+
509
+ <span class='name'>http_adapter</span>
510
+
511
+
512
+ <span class='type'>(<tt><span class='object_link'><a href="HTTPAdapter.html" title="CLX::HTTPAdapter (class)">HTTPAdapter</a></span></tt>)</span>
513
+
514
+
515
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
516
+
517
+
518
+ &mdash;
519
+ <div class='inline'>
520
+ <p>Used for testing</p>
521
+ </div>
522
+
523
+ </li>
524
+
525
+ </ul>
526
+
527
+
528
+ </div><table class="source_code">
529
+ <tr>
530
+ <td>
531
+ <pre class="lines">
532
+
533
+
534
+ 18
535
+ 19
536
+ 20
537
+ 21
538
+ 22
539
+ 23</pre>
540
+ </td>
541
+ <td>
542
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 18</span>
543
+
544
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_username'>username</span><span class='comma'>,</span> <span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_http_adapter'>http_adapter</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
545
+ <span class='id identifier rubyid_http_adapter'>http_adapter</span> <span class='op'>=</span> <span class='id identifier rubyid_http_adapter'>http_adapter</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='const'>HTTPAdapter</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='op'>:</span> <span class='id identifier rubyid_http_adapter'>http_adapter</span>
546
+ <span class='id identifier rubyid_http_adapter'>http_adapter</span><span class='period'>.</span><span class='id identifier rubyid_set_auth'>set_auth</span><span class='lparen'>(</span><span class='id identifier rubyid_username'>username</span><span class='comma'>,</span> <span class='id identifier rubyid_password'>password</span><span class='rparen'>)</span>
547
+
548
+ <span class='ivar'>@http_client</span> <span class='op'>=</span> <span class='const'>HTTPClient</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>CLX</span><span class='op'>::</span><span class='id identifier rubyid_base_url'>base_url</span><span class='comma'>,</span> <span class='id identifier rubyid_http_adapter'>http_adapter</span><span class='rparen'>)</span>
549
+ <span class='kw'>end</span></pre>
550
+ </td>
551
+ </tr>
552
+ </table>
553
+ </div>
554
+
555
+ </div>
556
+
557
+ <div id="instance_attr_details" class="attr_details">
558
+ <h2>Instance Attribute Details</h2>
559
+
560
+
561
+ <span id="http_client=-instance_method"></span>
562
+ <div class="method_details first">
563
+ <h3 class="signature first" id="http_client-instance_method">
564
+
565
+ - (<tt>Object</tt>) <strong>http_client</strong>
566
+
567
+
568
+
569
+
570
+
571
+ </h3><div class="docstring">
572
+ <div class="discussion">
573
+
574
+ <p>Mostly for testing</p>
575
+
576
+
577
+ </div>
578
+ </div>
579
+ <div class="tags">
580
+
581
+
582
+ </div><table class="source_code">
583
+ <tr>
584
+ <td>
585
+ <pre class="lines">
586
+
587
+
588
+ 8
589
+ 9
590
+ 10</pre>
591
+ </td>
592
+ <td>
593
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 8</span>
594
+
595
+ <span class='kw'>def</span> <span class='id identifier rubyid_http_client'>http_client</span>
596
+ <span class='ivar'>@http_client</span>
597
+ <span class='kw'>end</span></pre>
598
+ </td>
599
+ </tr>
600
+ </table>
601
+ </div>
602
+
603
+ </div>
604
+
605
+
606
+ <div id="instance_method_details" class="method_details_list">
607
+ <h2>Instance Method Details</h2>
608
+
609
+
610
+ <div class="method_details first">
611
+ <h3 class="signature first" id="get_gateway_by_id-instance_method">
612
+
613
+ - (<tt>hash</tt>) <strong>get_gateway_by_id</strong>(gateway_id)
614
+
615
+
616
+
617
+
618
+
619
+ </h3><div class="docstring">
620
+ <div class="discussion">
621
+
622
+ <p>Get one gateway based on it&#39;s gateway id</p>
623
+
624
+
625
+ </div>
626
+ </div>
627
+ <div class="tags">
628
+ <p class="tag_title">Parameters:</p>
629
+ <ul class="param">
630
+
631
+ <li>
632
+
633
+ <span class='name'>gateway_id</span>
634
+
635
+
636
+ <span class='type'>(<tt>Integer</tt>)</span>
637
+
638
+
639
+
640
+ &mdash;
641
+ <div class='inline'>
642
+ <p>Gateway ID</p>
643
+ </div>
644
+
645
+ </li>
646
+
647
+ </ul>
648
+
649
+ <p class="tag_title">Returns:</p>
650
+ <ul class="return">
651
+
652
+ <li>
653
+
654
+
655
+ <span class='type'>(<tt>hash</tt>)</span>
656
+
657
+
658
+
659
+ &mdash;
660
+ <div class='inline'>
661
+ <p>gateway One operators as hash.</p>
662
+ </div>
663
+
664
+ </li>
665
+
666
+ </ul>
667
+
668
+ </div><table class="source_code">
669
+ <tr>
670
+ <td>
671
+ <pre class="lines">
672
+
673
+
674
+ 74
675
+ 75
676
+ 76
677
+ 77
678
+ 78</pre>
679
+ </td>
680
+ <td>
681
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 74</span>
682
+
683
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_gateway_by_id'>get_gateway_by_id</span><span class='lparen'>(</span><span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='rparen'>)</span>
684
+ <span class='id identifier rubyid_valid_id?'>valid_id?</span><span class='lparen'>(</span><span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='rparen'>)</span>
685
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='const'>CLX</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span><span class='lbracket'>[</span><span class='symbol'>:gateway</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
686
+ <span class='ivar'>@http_client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
687
+ <span class='kw'>end</span></pre>
688
+ </td>
689
+ </tr>
690
+ </table>
691
+ </div>
692
+
693
+ <div class="method_details ">
694
+ <h3 class="signature " id="get_gateways-instance_method">
695
+
696
+ - (<tt>hash</tt>) <strong>get_gateways</strong>
697
+
698
+
699
+
700
+
701
+
702
+ </h3><div class="docstring">
703
+ <div class="discussion">
704
+
705
+ <p>Get all gateways</p>
706
+
707
+
708
+ </div>
709
+ </div>
710
+ <div class="tags">
711
+
712
+ <p class="tag_title">Returns:</p>
713
+ <ul class="return">
714
+
715
+ <li>
716
+
717
+
718
+ <span class='type'>(<tt>hash</tt>)</span>
719
+
720
+
721
+
722
+ &mdash;
723
+ <div class='inline'>
724
+ <p>gateways list of gateways as hash.</p>
725
+ </div>
726
+
727
+ </li>
728
+
729
+ </ul>
730
+
731
+ </div><table class="source_code">
732
+ <tr>
733
+ <td>
734
+ <pre class="lines">
735
+
736
+
737
+ 65
738
+ 66
739
+ 67
740
+ 68</pre>
741
+ </td>
742
+ <td>
743
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 65</span>
744
+
745
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_gateways'>get_gateways</span>
746
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='const'>CLX</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span><span class='lbracket'>[</span><span class='symbol'>:gateway</span><span class='rbracket'>]</span>
747
+ <span class='ivar'>@http_client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
748
+ <span class='kw'>end</span></pre>
749
+ </td>
750
+ </tr>
751
+ </table>
752
+ </div>
753
+
754
+ <div class="method_details ">
755
+ <h3 class="signature " id="get_operator_by_id-instance_method">
756
+
757
+ - (<tt>hash</tt>) <strong>get_operator_by_id</strong>(operator_id)
758
+
759
+
760
+
761
+
762
+
763
+ </h3><div class="docstring">
764
+ <div class="discussion">
765
+
766
+ <p>Get one operator based on it&#39;s operator id</p>
767
+
768
+
769
+ </div>
770
+ </div>
771
+ <div class="tags">
772
+
773
+ <div class="examples">
774
+ <p class="tag_title">Examples:</p>
775
+
776
+
777
+ <pre class="example code"><code><span class='id identifier rubyid_clx_api'>clx_api</span> <span class='op'>=</span> <span class='const'>CLX</span><span class='op'>::</span><span class='const'>API</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>my_username</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'>my_password</span><span class='tstring_end'>&#39;</span></span>
778
+ <span class='id identifier rubyid_operator'>operator</span> <span class='op'>=</span> <span class='id identifier rubyid_clx_api'>clx_api</span><span class='period'>.</span><span class='id identifier rubyid_get_operator'>get_operator</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span></code></pre>
779
+
780
+ </div>
781
+ <p class="tag_title">Parameters:</p>
782
+ <ul class="param">
783
+
784
+ <li>
785
+
786
+ <span class='name'>operator_id</span>
787
+
788
+
789
+ <span class='type'>(<tt>Integer</tt>)</span>
790
+
791
+
792
+
793
+ &mdash;
794
+ <div class='inline'>
795
+ <p>Operator ID</p>
796
+ </div>
797
+
798
+ </li>
799
+
800
+ </ul>
801
+
802
+ <p class="tag_title">Returns:</p>
803
+ <ul class="return">
804
+
805
+ <li>
806
+
807
+
808
+ <span class='type'>(<tt>hash</tt>)</span>
809
+
810
+
811
+
812
+ &mdash;
813
+ <div class='inline'>
814
+ <p>operator One operator as hash.</p>
815
+ </div>
816
+
817
+ </li>
818
+
819
+ </ul>
820
+
821
+ </div><table class="source_code">
822
+ <tr>
823
+ <td>
824
+ <pre class="lines">
825
+
826
+
827
+ 56
828
+ 57
829
+ 58
830
+ 59
831
+ 60</pre>
832
+ </td>
833
+ <td>
834
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 56</span>
835
+
836
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_operator_by_id'>get_operator_by_id</span><span class='lparen'>(</span><span class='id identifier rubyid_operator_id'>operator_id</span><span class='rparen'>)</span>
837
+ <span class='id identifier rubyid_valid_id?'>valid_id?</span><span class='lparen'>(</span><span class='id identifier rubyid_operator_id'>operator_id</span><span class='rparen'>)</span>
838
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='const'>CLX</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span><span class='lbracket'>[</span><span class='symbol'>:operator</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_operator_id'>operator_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
839
+ <span class='ivar'>@http_client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
840
+ <span class='kw'>end</span></pre>
841
+ </td>
842
+ </tr>
843
+ </table>
844
+ </div>
845
+
846
+ <div class="method_details ">
847
+ <h3 class="signature " id="get_operators-instance_method">
848
+
849
+ - (<tt>hash</tt>) <strong>get_operators</strong>
850
+
851
+
852
+
853
+
854
+
855
+ </h3><div class="docstring">
856
+ <div class="discussion">
857
+
858
+ <p>Get all operators from the API</p>
859
+
860
+
861
+ </div>
862
+ </div>
863
+ <div class="tags">
864
+
865
+ <div class="examples">
866
+ <p class="tag_title">Examples:</p>
867
+
868
+
869
+ <pre class="example code"><code><span class='id identifier rubyid_clx_api'>clx_api</span> <span class='op'>=</span> <span class='const'>CLX</span><span class='op'>::</span><span class='const'>API</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>my_username</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'>my_password</span><span class='tstring_end'>&#39;</span></span>
870
+ <span class='id identifier rubyid_operators'>operators</span> <span class='op'>=</span> <span class='id identifier rubyid_clx_api'>clx_api</span><span class='period'>.</span><span class='id identifier rubyid_get_operators'>get_operators</span></code></pre>
871
+
872
+ </div>
873
+
874
+ <p class="tag_title">Returns:</p>
875
+ <ul class="return">
876
+
877
+ <li>
878
+
879
+
880
+ <span class='type'>(<tt>hash</tt>)</span>
881
+
882
+
883
+
884
+ &mdash;
885
+ <div class='inline'>
886
+ <p>operators list of operators as hash.</p>
887
+ </div>
888
+
889
+ </li>
890
+
891
+ </ul>
892
+
893
+ </div><table class="source_code">
894
+ <tr>
895
+ <td>
896
+ <pre class="lines">
897
+
898
+
899
+ 44
900
+ 45
901
+ 46
902
+ 47</pre>
903
+ </td>
904
+ <td>
905
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 44</span>
906
+
907
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_operators'>get_operators</span>
908
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='const'>CLX</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span><span class='lbracket'>[</span><span class='symbol'>:operator</span><span class='rbracket'>]</span>
909
+ <span class='ivar'>@http_client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
910
+ <span class='kw'>end</span></pre>
911
+ </td>
912
+ </tr>
913
+ </table>
914
+ </div>
915
+
916
+ <div class="method_details ">
917
+ <h3 class="signature " id="get_price_entires_by_gateway_id-instance_method">
918
+
919
+ - (<tt>hash</tt>) <strong>get_price_entires_by_gateway_id</strong>(gateway_id)
920
+
921
+
922
+
923
+
924
+
925
+ </h3><div class="docstring">
926
+ <div class="discussion">
927
+
928
+ <p>Get price entires based on gateway id</p>
929
+
930
+
931
+ </div>
932
+ </div>
933
+ <div class="tags">
934
+ <p class="tag_title">Parameters:</p>
935
+ <ul class="param">
936
+
937
+ <li>
938
+
939
+ <span class='name'>gateway_id</span>
940
+
941
+
942
+ <span class='type'>(<tt>Integer</tt>)</span>
943
+
944
+
945
+
946
+ &mdash;
947
+ <div class='inline'>
948
+ <p>Gateway ID</p>
949
+ </div>
950
+
951
+ </li>
952
+
953
+ </ul>
954
+
955
+ <p class="tag_title">Returns:</p>
956
+ <ul class="return">
957
+
958
+ <li>
959
+
960
+
961
+ <span class='type'>(<tt>hash</tt>)</span>
962
+
963
+
964
+
965
+ &mdash;
966
+ <div class='inline'>
967
+ <p>price_entires list of price entries as hash.</p>
968
+ </div>
969
+
970
+ </li>
971
+
972
+ </ul>
973
+
974
+ </div><table class="source_code">
975
+ <tr>
976
+ <td>
977
+ <pre class="lines">
978
+
979
+
980
+ 84
981
+ 85
982
+ 86
983
+ 87
984
+ 88</pre>
985
+ </td>
986
+ <td>
987
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 84</span>
988
+
989
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_price_entires_by_gateway_id'>get_price_entires_by_gateway_id</span><span class='lparen'>(</span><span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='rparen'>)</span>
990
+ <span class='id identifier rubyid_valid_id?'>valid_id?</span><span class='lparen'>(</span><span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='rparen'>)</span>
991
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='const'>CLX</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span><span class='lbracket'>[</span><span class='symbol'>:gateway</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/price</span><span class='tstring_end'>&#39;</span></span>
992
+ <span class='ivar'>@http_client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
993
+ <span class='kw'>end</span></pre>
994
+ </td>
995
+ </tr>
996
+ </table>
997
+ </div>
998
+
999
+ <div class="method_details ">
1000
+ <h3 class="signature " id="get_price_entries_by_gateway_id_and_operator_id-instance_method">
1001
+
1002
+ - (<tt>hash</tt>) <strong>get_price_entries_by_gateway_id_and_operator_id</strong>(gateway_id, operator_id)
1003
+
1004
+
1005
+
1006
+
1007
+
1008
+ </h3><div class="docstring">
1009
+ <div class="discussion">
1010
+
1011
+ <p>Get price entiry based on gateway id and operator id</p>
1012
+
1013
+
1014
+ </div>
1015
+ </div>
1016
+ <div class="tags">
1017
+ <p class="tag_title">Parameters:</p>
1018
+ <ul class="param">
1019
+
1020
+ <li>
1021
+
1022
+ <span class='name'>gateway_id</span>
1023
+
1024
+
1025
+ <span class='type'>(<tt>Integer</tt>)</span>
1026
+
1027
+
1028
+
1029
+ &mdash;
1030
+ <div class='inline'>
1031
+ <p>Gateway ID</p>
1032
+ </div>
1033
+
1034
+ </li>
1035
+
1036
+ <li>
1037
+
1038
+ <span class='name'>operator_id</span>
1039
+
1040
+
1041
+ <span class='type'>(<tt>Integer</tt>)</span>
1042
+
1043
+
1044
+
1045
+ &mdash;
1046
+ <div class='inline'>
1047
+ <p>Operator ID</p>
1048
+ </div>
1049
+
1050
+ </li>
1051
+
1052
+ </ul>
1053
+
1054
+ <p class="tag_title">Returns:</p>
1055
+ <ul class="return">
1056
+
1057
+ <li>
1058
+
1059
+
1060
+ <span class='type'>(<tt>hash</tt>)</span>
1061
+
1062
+
1063
+
1064
+ &mdash;
1065
+ <div class='inline'>
1066
+ <p>price_entry one price entry as hash.</p>
1067
+ </div>
1068
+
1069
+ </li>
1070
+
1071
+ </ul>
1072
+
1073
+ </div><table class="source_code">
1074
+ <tr>
1075
+ <td>
1076
+ <pre class="lines">
1077
+
1078
+
1079
+ 95
1080
+ 96
1081
+ 97
1082
+ 98
1083
+ 99
1084
+ 100</pre>
1085
+ </td>
1086
+ <td>
1087
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 95</span>
1088
+
1089
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_price_entries_by_gateway_id_and_operator_id'>get_price_entries_by_gateway_id_and_operator_id</span><span class='lparen'>(</span><span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='comma'>,</span> <span class='id identifier rubyid_operator_id'>operator_id</span><span class='rparen'>)</span>
1090
+ <span class='id identifier rubyid_valid_id?'>valid_id?</span><span class='lparen'>(</span><span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='rparen'>)</span>
1091
+ <span class='id identifier rubyid_valid_id?'>valid_id?</span><span class='lparen'>(</span><span class='id identifier rubyid_operator_id'>operator_id</span><span class='rparen'>)</span>
1092
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='const'>CLX</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span><span class='lbracket'>[</span><span class='symbol'>:gateway</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/price/</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_operator_id'>operator_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
1093
+ <span class='ivar'>@http_client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
1094
+ <span class='kw'>end</span></pre>
1095
+ </td>
1096
+ </tr>
1097
+ </table>
1098
+ </div>
1099
+
1100
+ <div class="method_details ">
1101
+ <h3 class="signature " id="get_price_entries_by_gateway_id_and_operator_id_and_date-instance_method">
1102
+
1103
+ - (<tt>hash</tt>) <strong>get_price_entries_by_gateway_id_and_operator_id_and_date</strong>(gateway_id, operator_id, date)
1104
+
1105
+
1106
+
1107
+
1108
+
1109
+ </h3><div class="docstring">
1110
+ <div class="discussion">
1111
+
1112
+ <p>Get price entiry based on gateway id, operator id and a date</p>
1113
+
1114
+
1115
+ </div>
1116
+ </div>
1117
+ <div class="tags">
1118
+ <p class="tag_title">Parameters:</p>
1119
+ <ul class="param">
1120
+
1121
+ <li>
1122
+
1123
+ <span class='name'>gateway_id</span>
1124
+
1125
+
1126
+ <span class='type'>(<tt>Integer</tt>)</span>
1127
+
1128
+
1129
+
1130
+ &mdash;
1131
+ <div class='inline'>
1132
+ <p>Gateway ID</p>
1133
+ </div>
1134
+
1135
+ </li>
1136
+
1137
+ <li>
1138
+
1139
+ <span class='name'>operator_id</span>
1140
+
1141
+
1142
+ <span class='type'>(<tt>Integer</tt>)</span>
1143
+
1144
+
1145
+
1146
+ &mdash;
1147
+ <div class='inline'>
1148
+ <p>Operator ID</p>
1149
+ </div>
1150
+
1151
+ </li>
1152
+
1153
+ <li>
1154
+
1155
+ <span class='name'>date</span>
1156
+
1157
+
1158
+ <span class='type'>(<tt>DateTime</tt>)</span>
1159
+
1160
+
1161
+
1162
+ &mdash;
1163
+ <div class='inline'>
1164
+ <p>DateTime</p>
1165
+ </div>
1166
+
1167
+ </li>
1168
+
1169
+ </ul>
1170
+
1171
+ <p class="tag_title">Returns:</p>
1172
+ <ul class="return">
1173
+
1174
+ <li>
1175
+
1176
+
1177
+ <span class='type'>(<tt>hash</tt>)</span>
1178
+
1179
+
1180
+
1181
+ &mdash;
1182
+ <div class='inline'>
1183
+ <p>price_entry one price entry as hash.</p>
1184
+ </div>
1185
+
1186
+ </li>
1187
+
1188
+ </ul>
1189
+
1190
+ </div><table class="source_code">
1191
+ <tr>
1192
+ <td>
1193
+ <pre class="lines">
1194
+
1195
+
1196
+ 108
1197
+ 109
1198
+ 110
1199
+ 111
1200
+ 112
1201
+ 113
1202
+ 114
1203
+ 115</pre>
1204
+ </td>
1205
+ <td>
1206
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 108</span>
1207
+
1208
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_price_entries_by_gateway_id_and_operator_id_and_date'>get_price_entries_by_gateway_id_and_operator_id_and_date</span><span class='lparen'>(</span><span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='comma'>,</span> <span class='id identifier rubyid_operator_id'>operator_id</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
1209
+ <span class='id identifier rubyid_valid_id?'>valid_id?</span><span class='lparen'>(</span><span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='rparen'>)</span>
1210
+ <span class='id identifier rubyid_valid_id?'>valid_id?</span><span class='lparen'>(</span><span class='id identifier rubyid_operator_id'>operator_id</span><span class='rparen'>)</span>
1211
+ <span class='id identifier rubyid_valid_date?'>valid_date?</span><span class='lparen'>(</span><span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
1212
+ <span class='id identifier rubyid_date_query'>date_query</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>?date=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span><span class='embexpr_end'>}</span><span class='tstring_content'>-</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span><span class='embexpr_end'>}</span><span class='tstring_content'>-</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
1213
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='const'>CLX</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span><span class='lbracket'>[</span><span class='symbol'>:gateway</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_gateway_id'>gateway_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/price/</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_operator_id'>operator_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_date_query'>date_query</span>
1214
+ <span class='ivar'>@http_client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
1215
+ <span class='kw'>end</span></pre>
1216
+ </td>
1217
+ </tr>
1218
+ </table>
1219
+ </div>
1220
+
1221
+ <div class="method_details ">
1222
+ <h3 class="signature " id="set_auth-instance_method">
1223
+
1224
+ - (<tt>Object</tt>) <strong>set_auth</strong>(username, password)
1225
+
1226
+
1227
+
1228
+
1229
+
1230
+ </h3><div class="docstring">
1231
+ <div class="discussion">
1232
+
1233
+ <p>Enables change of credentials after initialization</p>
1234
+
1235
+
1236
+ </div>
1237
+ </div>
1238
+ <div class="tags">
1239
+ <p class="tag_title">Parameters:</p>
1240
+ <ul class="param">
1241
+
1242
+ <li>
1243
+
1244
+ <span class='name'>username</span>
1245
+
1246
+
1247
+ <span class='type'>(<tt>String</tt>)</span>
1248
+
1249
+
1250
+
1251
+ </li>
1252
+
1253
+ <li>
1254
+
1255
+ <span class='name'>password</span>
1256
+
1257
+
1258
+ <span class='type'>(<tt>String</tt>)</span>
1259
+
1260
+
1261
+
1262
+ </li>
1263
+
1264
+ </ul>
1265
+
1266
+
1267
+ </div><table class="source_code">
1268
+ <tr>
1269
+ <td>
1270
+ <pre class="lines">
1271
+
1272
+
1273
+ 28
1274
+ 29
1275
+ 30</pre>
1276
+ </td>
1277
+ <td>
1278
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 28</span>
1279
+
1280
+ <span class='kw'>def</span> <span class='id identifier rubyid_set_auth'>set_auth</span><span class='lparen'>(</span><span class='id identifier rubyid_username'>username</span><span class='comma'>,</span> <span class='id identifier rubyid_password'>password</span><span class='rparen'>)</span>
1281
+ <span class='ivar'>@http_client</span><span class='period'>.</span><span class='id identifier rubyid_http_adapter'>http_adapter</span><span class='period'>.</span><span class='id identifier rubyid_set_auth'>set_auth</span><span class='lparen'>(</span><span class='id identifier rubyid_username'>username</span><span class='comma'>,</span> <span class='id identifier rubyid_password'>password</span><span class='rparen'>)</span>
1282
+ <span class='kw'>end</span></pre>
1283
+ </td>
1284
+ </tr>
1285
+ </table>
1286
+ </div>
1287
+
1288
+ <div class="method_details ">
1289
+ <h3 class="signature " id="set_base_url-instance_method">
1290
+
1291
+ - (<tt>Object</tt>) <strong>set_base_url</strong>(url)
1292
+
1293
+
1294
+
1295
+
1296
+
1297
+ </h3><div class="docstring">
1298
+ <div class="discussion">
1299
+
1300
+ <p>Enables change of base URL after initialization</p>
1301
+
1302
+
1303
+ </div>
1304
+ </div>
1305
+ <div class="tags">
1306
+ <p class="tag_title">Parameters:</p>
1307
+ <ul class="param">
1308
+
1309
+ <li>
1310
+
1311
+ <span class='name'>url</span>
1312
+
1313
+
1314
+ <span class='type'>(<tt>String</tt>)</span>
1315
+
1316
+
1317
+
1318
+ </li>
1319
+
1320
+ </ul>
1321
+
1322
+
1323
+ </div><table class="source_code">
1324
+ <tr>
1325
+ <td>
1326
+ <pre class="lines">
1327
+
1328
+
1329
+ 34
1330
+ 35
1331
+ 36</pre>
1332
+ </td>
1333
+ <td>
1334
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 34</span>
1335
+
1336
+ <span class='kw'>def</span> <span class='id identifier rubyid_set_base_url'>set_base_url</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
1337
+ <span class='ivar'>@http_client</span><span class='period'>.</span><span class='id identifier rubyid_base_url'>base_url</span> <span class='op'>=</span> <span class='id identifier rubyid_url'>url</span>
1338
+ <span class='kw'>end</span></pre>
1339
+ </td>
1340
+ </tr>
1341
+ </table>
1342
+ </div>
1343
+
1344
+ <div class="method_details ">
1345
+ <h3 class="signature " id="valid_date?-instance_method">
1346
+
1347
+ - (<tt>Boolean</tt>) <strong>valid_date?</strong>(date) <span class="extras">(private)</span>
1348
+
1349
+
1350
+
1351
+
1352
+
1353
+ </h3><div class="docstring">
1354
+ <div class="discussion">
1355
+
1356
+ <p>Validates that date is of type DateTime</p>
1357
+
1358
+
1359
+ </div>
1360
+ </div>
1361
+ <div class="tags">
1362
+
1363
+ <p class="tag_title">Returns:</p>
1364
+ <ul class="return">
1365
+
1366
+ <li>
1367
+
1368
+
1369
+ <span class='type'>(<tt>Boolean</tt>)</span>
1370
+
1371
+
1372
+
1373
+ </li>
1374
+
1375
+ </ul>
1376
+ <p class="tag_title">Raises:</p>
1377
+ <ul class="raise">
1378
+
1379
+ <li>
1380
+
1381
+
1382
+ <span class='type'>(<tt><span class='object_link'><a href="CLXException.html" title="CLX::CLXException (class)">CLXException</a></span></tt>)</span>
1383
+
1384
+
1385
+
1386
+ </li>
1387
+
1388
+ </ul>
1389
+
1390
+ </div><table class="source_code">
1391
+ <tr>
1392
+ <td>
1393
+ <pre class="lines">
1394
+
1395
+
1396
+ 126
1397
+ 127
1398
+ 128</pre>
1399
+ </td>
1400
+ <td>
1401
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 126</span>
1402
+
1403
+ <span class='kw'>def</span> <span class='id identifier rubyid_valid_date?'>valid_date?</span><span class='lparen'>(</span><span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
1404
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>CLXException</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Date must be of type DateTime</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>DateTime</span>
1405
+ <span class='kw'>end</span></pre>
1406
+ </td>
1407
+ </tr>
1408
+ </table>
1409
+ </div>
1410
+
1411
+ <div class="method_details ">
1412
+ <h3 class="signature " id="valid_id?-instance_method">
1413
+
1414
+ - (<tt>Boolean</tt>) <strong>valid_id?</strong>(id) <span class="extras">(private)</span>
1415
+
1416
+
1417
+
1418
+
1419
+
1420
+ </h3><div class="docstring">
1421
+ <div class="discussion">
1422
+
1423
+ <p>Validates that in is of type integer and is grater than zero</p>
1424
+
1425
+
1426
+ </div>
1427
+ </div>
1428
+ <div class="tags">
1429
+
1430
+ <p class="tag_title">Returns:</p>
1431
+ <ul class="return">
1432
+
1433
+ <li>
1434
+
1435
+
1436
+ <span class='type'>(<tt>Boolean</tt>)</span>
1437
+
1438
+
1439
+
1440
+ </li>
1441
+
1442
+ </ul>
1443
+ <p class="tag_title">Raises:</p>
1444
+ <ul class="raise">
1445
+
1446
+ <li>
1447
+
1448
+
1449
+ <span class='type'>(<tt><span class='object_link'><a href="CLXException.html" title="CLX::CLXException (class)">CLXException</a></span></tt>)</span>
1450
+
1451
+
1452
+
1453
+ </li>
1454
+
1455
+ </ul>
1456
+
1457
+ </div><table class="source_code">
1458
+ <tr>
1459
+ <td>
1460
+ <pre class="lines">
1461
+
1462
+
1463
+ 120
1464
+ 121
1465
+ 122
1466
+ 123</pre>
1467
+ </td>
1468
+ <td>
1469
+ <pre class="code"><span class="info file"># File 'lib/clx_api/api.rb', line 120</span>
1470
+
1471
+ <span class='kw'>def</span> <span class='id identifier rubyid_valid_id?'>valid_id?</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
1472
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>CLXException</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Id must be integer</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_id'>id</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Integer</span>
1473
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>CLXException</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Id must be greater than zero</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_id'>id</span> <span class='op'>&gt;</span> <span class='int'>0</span>
1474
+ <span class='kw'>end</span></pre>
1475
+ </td>
1476
+ </tr>
1477
+ </table>
1478
+ </div>
1479
+
1480
+ </div>
1481
+
1482
+ </div>
1483
+
1484
+ <div id="footer">
1485
+ Generated on Mon May 25 12:34:50 2015 by
1486
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1487
+ 0.8.7.6 (ruby-2.1.5).
1488
+ </div>
1489
+
1490
+ </body>
1491
+ </html>