stub_requests 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +7 -0
  3. data/.reek.yml +1 -0
  4. data/.rubocop.yml +2 -0
  5. data/.travis.yml +15 -0
  6. data/.yardopts +1 -1
  7. data/Appraisals +11 -0
  8. data/CHANGELOG.md +17 -0
  9. data/README.md +15 -2
  10. data/Rakefile +16 -1
  11. data/docs/.gitkeep +0 -0
  12. data/docs/Array.html +137 -0
  13. data/docs/FalseClass.html +232 -0
  14. data/docs/Hash.html +137 -0
  15. data/docs/NilClass.html +232 -0
  16. data/docs/Numeric.html +233 -0
  17. data/docs/Object.html +396 -0
  18. data/docs/String.html +298 -0
  19. data/docs/StubRequests/API.html +651 -0
  20. data/docs/StubRequests/ArgumentValidation.html +309 -0
  21. data/docs/StubRequests/Endpoint.html +1187 -0
  22. data/docs/StubRequests/EndpointNotFound.html +157 -0
  23. data/docs/StubRequests/EndpointRegistry.html +1527 -0
  24. data/docs/StubRequests/Error.html +153 -0
  25. data/docs/StubRequests/HashUtil.html +304 -0
  26. data/docs/StubRequests/InvalidType.html +252 -0
  27. data/docs/StubRequests/InvalidUri.html +252 -0
  28. data/docs/StubRequests/Service.html +1307 -0
  29. data/docs/StubRequests/ServiceHaveEndpoints.html +244 -0
  30. data/docs/StubRequests/ServiceNotFound.html +252 -0
  31. data/docs/StubRequests/ServiceRegistry.html +1031 -0
  32. data/docs/StubRequests/URI/Builder.html +1194 -0
  33. data/docs/StubRequests/URI/Scheme.html +315 -0
  34. data/docs/StubRequests/URI/Suffix.html +315 -0
  35. data/docs/StubRequests/URI/Validator.html +770 -0
  36. data/docs/StubRequests/URI.html +144 -0
  37. data/docs/StubRequests/UriSegmentMismatch.html +157 -0
  38. data/docs/StubRequests/WebMockBuilder.html +887 -0
  39. data/docs/StubRequests.html +452 -0
  40. data/docs/Time.html +232 -0
  41. data/docs/TrueClass.html +232 -0
  42. data/docs/_config.yml +1 -0
  43. data/docs/_index.html +391 -0
  44. data/docs/class_list.html +51 -0
  45. data/docs/css/common.css +1 -0
  46. data/docs/css/full_list.css +58 -0
  47. data/docs/css/style.css +496 -0
  48. data/docs/file.README.html +225 -0
  49. data/docs/file_list.html +56 -0
  50. data/docs/frames.html +17 -0
  51. data/docs/index.html +225 -0
  52. data/docs/js/app.js +292 -0
  53. data/docs/js/full_list.js +216 -0
  54. data/docs/js/jquery.js +4 -0
  55. data/docs/method_list.html +707 -0
  56. data/docs/top-level-namespace.html +112 -0
  57. data/gemfiles/.bundle/config +2 -0
  58. data/gemfiles/webmock_2.3.gemfile +8 -0
  59. data/gemfiles/webmock_2.3.gemfile.lock +206 -0
  60. data/gemfiles/webmock_3.5.gemfile +8 -0
  61. data/gemfiles/webmock_3.5.gemfile.lock +206 -0
  62. data/gemfiles/webmock_develop.gemfile +8 -0
  63. data/gemfiles/webmock_develop.gemfile.lock +211 -0
  64. data/lib/stub_requests/version.rb +1 -1
  65. data/lib/tasks/changelog.rake +18 -0
  66. data/lib/tasks/gem.rake +15 -0
  67. data/lib/tasks/git.rake +40 -0
  68. data/stub_requests.gemspec +23 -12
  69. metadata +138 -25
@@ -0,0 +1,1031 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: StubRequests::ServiceRegistry
8
+
9
+ &mdash; Documentation by YARD 0.9.18
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 = "StubRequests::ServiceRegistry";
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?1"></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 (S)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../StubRequests.html" title="StubRequests (module)">StubRequests</a></span></span>
41
+ &raquo;
42
+ <span class="title">ServiceRegistry</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
+ <div id="content"><h1>Class: StubRequests::ServiceRegistry
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
76
+
77
+ <li class="next">StubRequests::ServiceRegistry</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <dl>
91
+ <dt>Includes:</dt>
92
+ <dd>Enumerable, Singleton</dd>
93
+ </dl>
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>lib/stub_requests/service_registry.rb</dd>
103
+ </dl>
104
+
105
+ </div>
106
+
107
+ <h2>Overview</h2><div class="docstring">
108
+ <div class="discussion">
109
+ <p>Class ServiceRegistry provides registration of services</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+ <p class="tag_title">Since:</p>
117
+ <ul class="since">
118
+
119
+ <li>
120
+
121
+
122
+
123
+
124
+
125
+ <div class='inline'><p>0.1.0</p>
126
+ </div>
127
+
128
+ </li>
129
+
130
+ </ul>
131
+
132
+ </div>
133
+
134
+
135
+
136
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
137
+ <ul class="summary">
138
+
139
+ <li class="public ">
140
+ <span class="summary_signature">
141
+
142
+ <a href="#services-instance_method" title="#services (instance method)">#<strong>services</strong> &#x21d2; Object </a>
143
+
144
+
145
+
146
+ </span>
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+ <span class="summary_desc"><div class='inline'></div></span>
160
+
161
+ </li>
162
+
163
+
164
+ </ul>
165
+
166
+
167
+
168
+
169
+
170
+ <h2>
171
+ Instance Method Summary
172
+ <small><a href="#" class="summary_toggle">collapse</a></small>
173
+ </h2>
174
+
175
+ <ul class="summary">
176
+
177
+ <li class="public ">
178
+ <span class="summary_signature">
179
+
180
+ <a href="#each-instance_method" title="#each (instance method)">#<strong>each</strong> { ... } &#x21d2; Concurrent::Map&lt;Symbol, Service&gt; </a>
181
+
182
+
183
+
184
+ </span>
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+ <span class="summary_desc"><div class='inline'><p>Required by Enumerable.</p>
195
+ </div></span>
196
+
197
+ </li>
198
+
199
+
200
+ <li class="public ">
201
+ <span class="summary_signature">
202
+
203
+ <a href="#get_service-instance_method" title="#get_service (instance method)">#<strong>get_service</strong>(service_id) &#x21d2; Service </a>
204
+
205
+
206
+
207
+ </span>
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+ <span class="summary_desc"><div class='inline'><p>Fetches a service from the registry.</p>
218
+ </div></span>
219
+
220
+ </li>
221
+
222
+
223
+ <li class="public ">
224
+ <span class="summary_signature">
225
+
226
+ <a href="#get_service!-instance_method" title="#get_service! (instance method)">#<strong>get_service!</strong>(service_id) &#x21d2; Endpoint </a>
227
+
228
+
229
+
230
+ </span>
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+ <span class="summary_desc"><div class='inline'><p>Fetches a service from the registry or raises <span class='object_link'><a href="ServiceNotFound.html" title="StubRequests::ServiceNotFound (class)">ServiceNotFound</a></span>.</p>
241
+ </div></span>
242
+
243
+ </li>
244
+
245
+
246
+ <li class="public ">
247
+ <span class="summary_signature">
248
+
249
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> &#x21d2; ServiceRegistry </a>
250
+
251
+
252
+
253
+ </span>
254
+
255
+
256
+ <span class="note title constructor">constructor</span>
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+ <span class="summary_desc"><div class='inline'><p>A new instance of ServiceRegistry.</p>
266
+ </div></span>
267
+
268
+ </li>
269
+
270
+
271
+ <li class="public ">
272
+ <span class="summary_signature">
273
+
274
+ <a href="#register_service-instance_method" title="#register_service (instance method)">#<strong>register_service</strong>(service_id, service_uri) &#x21d2; Service </a>
275
+
276
+
277
+
278
+ </span>
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+ <span class="summary_desc"><div class='inline'><p>Registers a service in the registry.</p>
289
+ </div></span>
290
+
291
+ </li>
292
+
293
+
294
+ <li class="public ">
295
+ <span class="summary_signature">
296
+
297
+ <a href="#remove_service-instance_method" title="#remove_service (instance method)">#<strong>remove_service</strong>(service_id) &#x21d2; Object </a>
298
+
299
+
300
+
301
+ </span>
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+ <span class="summary_desc"><div class='inline'><p>Removes a service from the registry.</p>
312
+ </div></span>
313
+
314
+ </li>
315
+
316
+
317
+ <li class="public ">
318
+ <span class="summary_signature">
319
+
320
+ <a href="#reset-instance_method" title="#reset (instance method)">#<strong>reset</strong> &#x21d2; Object </a>
321
+
322
+
323
+
324
+ </span>
325
+
326
+
327
+
328
+
329
+
330
+
331
+ <span class="private note title">private</span>
332
+
333
+
334
+ <span class="summary_desc"><div class='inline'><p>Resets the map with registered services.</p>
335
+ </div></span>
336
+
337
+ </li>
338
+
339
+
340
+ </ul>
341
+
342
+
343
+
344
+
345
+ <div id="constructor_details" class="method_details_list">
346
+ <h2>Constructor Details</h2>
347
+
348
+ <div class="method_details first">
349
+ <h3 class="signature first" id="initialize-instance_method">
350
+
351
+ #<strong>initialize</strong> &#x21d2; <tt><span class='object_link'><a href="" title="StubRequests::ServiceRegistry (class)">ServiceRegistry</a></span></tt>
352
+
353
+
354
+
355
+
356
+
357
+ </h3><div class="docstring">
358
+ <div class="discussion">
359
+ <p>Returns a new instance of ServiceRegistry</p>
360
+
361
+
362
+ </div>
363
+ </div>
364
+ <div class="tags">
365
+
366
+ <p class="tag_title">Since:</p>
367
+ <ul class="since">
368
+
369
+ <li>
370
+
371
+
372
+
373
+
374
+
375
+ <div class='inline'><p>0.1.0</p>
376
+ </div>
377
+
378
+ </li>
379
+
380
+ </ul>
381
+
382
+ </div><table class="source_code">
383
+ <tr>
384
+ <td>
385
+ <pre class="lines">
386
+
387
+
388
+ 25
389
+ 26
390
+ 27</pre>
391
+ </td>
392
+ <td>
393
+ <pre class="code"><span class="info file"># File 'lib/stub_requests/service_registry.rb', line 25</span>
394
+
395
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
396
+ <span class='ivar'>@services</span> <span class='op'>=</span> <span class='const'>Concurrent</span><span class='op'>::</span><span class='const'>Map</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
397
+ <span class='kw'>end</span></pre>
398
+ </td>
399
+ </tr>
400
+ </table>
401
+ </div>
402
+
403
+ </div>
404
+
405
+ <div id="instance_attr_details" class="attr_details">
406
+ <h2>Instance Attribute Details</h2>
407
+
408
+
409
+ <span id="services=-instance_method"></span>
410
+ <div class="method_details first">
411
+ <h3 class="signature first" id="services-instance_method">
412
+
413
+ #<strong>services</strong> &#x21d2; <tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>
414
+
415
+
416
+
417
+
418
+
419
+ </h3><div class="docstring">
420
+ <div class="discussion">
421
+
422
+
423
+ </div>
424
+ </div>
425
+ <div class="tags">
426
+
427
+ <p class="tag_title">Since:</p>
428
+ <ul class="since">
429
+
430
+ <li>
431
+
432
+
433
+
434
+
435
+
436
+ <div class='inline'><p>0.1.0</p>
437
+ </div>
438
+
439
+ </li>
440
+
441
+ </ul>
442
+
443
+ </div><table class="source_code">
444
+ <tr>
445
+ <td>
446
+ <pre class="lines">
447
+
448
+
449
+ 23
450
+ 24
451
+ 25</pre>
452
+ </td>
453
+ <td>
454
+ <pre class="code"><span class="info file"># File 'lib/stub_requests/service_registry.rb', line 23</span>
455
+
456
+ <span class='kw'>def</span> <span class='id identifier rubyid_services'>services</span>
457
+ <span class='ivar'>@services</span>
458
+ <span class='kw'>end</span></pre>
459
+ </td>
460
+ </tr>
461
+ </table>
462
+ </div>
463
+
464
+ </div>
465
+
466
+
467
+ <div id="instance_method_details" class="method_details_list">
468
+ <h2>Instance Method Details</h2>
469
+
470
+
471
+ <div class="method_details first">
472
+ <h3 class="signature first" id="each-instance_method">
473
+
474
+ #<strong>each</strong> { ... } &#x21d2; <tt>Concurrent::Map&lt;Symbol, <span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span>&gt;</tt>
475
+
476
+
477
+
478
+
479
+
480
+ </h3><div class="docstring">
481
+ <div class="discussion">
482
+ <p>Required by Enumerable</p>
483
+
484
+
485
+ </div>
486
+ </div>
487
+ <div class="tags">
488
+
489
+ <p class="tag_title">Yields:</p>
490
+ <ul class="yield">
491
+
492
+ <li>
493
+
494
+
495
+ <span class='type'></span>
496
+
497
+
498
+
499
+
500
+ <div class='inline'><p>used by Enumerable</p>
501
+ </div>
502
+
503
+ </li>
504
+
505
+ </ul>
506
+ <p class="tag_title">Returns:</p>
507
+ <ul class="return">
508
+
509
+ <li>
510
+
511
+
512
+ <span class='type'>(<tt>Concurrent::Map&lt;Symbol, <span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span>&gt;</tt>)</span>
513
+
514
+
515
+
516
+ &mdash;
517
+ <div class='inline'><p>an map with services</p>
518
+ </div>
519
+
520
+ </li>
521
+
522
+ </ul>
523
+ <p class="tag_title">Since:</p>
524
+ <ul class="since">
525
+
526
+ <li>
527
+
528
+
529
+
530
+
531
+
532
+ <div class='inline'><p>0.1.0</p>
533
+ </div>
534
+
535
+ </li>
536
+
537
+ </ul>
538
+
539
+ </div><table class="source_code">
540
+ <tr>
541
+ <td>
542
+ <pre class="lines">
543
+
544
+
545
+ 46
546
+ 47
547
+ 48</pre>
548
+ </td>
549
+ <td>
550
+ <pre class="code"><span class="info file"># File 'lib/stub_requests/service_registry.rb', line 46</span>
551
+
552
+ <span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
553
+ <span class='id identifier rubyid_services'>services</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
554
+ <span class='kw'>end</span></pre>
555
+ </td>
556
+ </tr>
557
+ </table>
558
+ </div>
559
+
560
+ <div class="method_details ">
561
+ <h3 class="signature " id="get_service-instance_method">
562
+
563
+ #<strong>get_service</strong>(service_id) &#x21d2; <tt><span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span></tt>
564
+
565
+
566
+
567
+
568
+
569
+ </h3><div class="docstring">
570
+ <div class="discussion">
571
+ <p>Fetches a service from the registry</p>
572
+
573
+
574
+ </div>
575
+ </div>
576
+ <div class="tags">
577
+ <p class="tag_title">Parameters:</p>
578
+ <ul class="param">
579
+
580
+ <li>
581
+
582
+ <span class='name'>service_id</span>
583
+
584
+
585
+ <span class='type'>(<tt>Symbol</tt>)</span>
586
+
587
+
588
+
589
+ &mdash;
590
+ <div class='inline'><p>id of the service to remove</p>
591
+ </div>
592
+
593
+ </li>
594
+
595
+ </ul>
596
+
597
+ <p class="tag_title">Returns:</p>
598
+ <ul class="return">
599
+
600
+ <li>
601
+
602
+
603
+ <span class='type'>(<tt><span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span></tt>)</span>
604
+
605
+
606
+
607
+ &mdash;
608
+ <div class='inline'><p>the found service</p>
609
+ </div>
610
+
611
+ </li>
612
+
613
+ </ul>
614
+ <p class="tag_title">Since:</p>
615
+ <ul class="since">
616
+
617
+ <li>
618
+
619
+
620
+
621
+
622
+
623
+ <div class='inline'><p>0.1.0</p>
624
+ </div>
625
+
626
+ </li>
627
+
628
+ </ul>
629
+
630
+ </div><table class="source_code">
631
+ <tr>
632
+ <td>
633
+ <pre class="lines">
634
+
635
+
636
+ 87
637
+ 88
638
+ 89</pre>
639
+ </td>
640
+ <td>
641
+ <pre class="code"><span class="info file"># File 'lib/stub_requests/service_registry.rb', line 87</span>
642
+
643
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_service'>get_service</span><span class='lparen'>(</span><span class='id identifier rubyid_service_id'>service_id</span><span class='rparen'>)</span>
644
+ <span class='id identifier rubyid_services'>services</span><span class='lbracket'>[</span><span class='id identifier rubyid_service_id'>service_id</span><span class='rbracket'>]</span>
645
+ <span class='kw'>end</span></pre>
646
+ </td>
647
+ </tr>
648
+ </table>
649
+ </div>
650
+
651
+ <div class="method_details ">
652
+ <h3 class="signature " id="get_service!-instance_method">
653
+
654
+ #<strong>get_service!</strong>(service_id) &#x21d2; <tt><span class='object_link'><a href="Endpoint.html" title="StubRequests::Endpoint (class)">Endpoint</a></span></tt>
655
+
656
+
657
+
658
+
659
+
660
+ </h3><div class="docstring">
661
+ <div class="discussion">
662
+ <p>Fetches a service from the registry or raises <span class='object_link'><a href="ServiceNotFound.html" title="StubRequests::ServiceNotFound (class)">StubRequests::ServiceNotFound</a></span></p>
663
+
664
+
665
+ </div>
666
+ </div>
667
+ <div class="tags">
668
+ <p class="tag_title">Parameters:</p>
669
+ <ul class="param">
670
+
671
+ <li>
672
+
673
+ <span class='name'>service_id</span>
674
+
675
+
676
+ <span class='type'>(<tt>Symbol</tt>)</span>
677
+
678
+
679
+
680
+ &mdash;
681
+ <div class='inline'><p>the id of a service</p>
682
+ </div>
683
+
684
+ </li>
685
+
686
+ </ul>
687
+
688
+ <p class="tag_title">Returns:</p>
689
+ <ul class="return">
690
+
691
+ <li>
692
+
693
+
694
+ <span class='type'>(<tt><span class='object_link'><a href="Endpoint.html" title="StubRequests::Endpoint (class)">Endpoint</a></span></tt>)</span>
695
+
696
+
697
+
698
+ </li>
699
+
700
+ </ul>
701
+ <p class="tag_title">Raises:</p>
702
+ <ul class="raise">
703
+
704
+ <li>
705
+
706
+
707
+ <span class='type'>(<tt><span class='object_link'><a href="ServiceNotFound.html" title="StubRequests::ServiceNotFound (class)">ServiceNotFound</a></span></tt>)</span>
708
+
709
+
710
+
711
+ &mdash;
712
+ <div class='inline'><p>when an endpoint couldn&#39;t be found</p>
713
+ </div>
714
+
715
+ </li>
716
+
717
+ </ul>
718
+ <p class="tag_title">Since:</p>
719
+ <ul class="since">
720
+
721
+ <li>
722
+
723
+
724
+
725
+
726
+
727
+ <div class='inline'><p>0.1.0</p>
728
+ </div>
729
+
730
+ </li>
731
+
732
+ </ul>
733
+
734
+ </div><table class="source_code">
735
+ <tr>
736
+ <td>
737
+ <pre class="lines">
738
+
739
+
740
+ 101
741
+ 102
742
+ 103</pre>
743
+ </td>
744
+ <td>
745
+ <pre class="code"><span class="info file"># File 'lib/stub_requests/service_registry.rb', line 101</span>
746
+
747
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_service!'>get_service!</span><span class='lparen'>(</span><span class='id identifier rubyid_service_id'>service_id</span><span class='rparen'>)</span>
748
+ <span class='id identifier rubyid_get_service'>get_service</span><span class='lparen'>(</span><span class='id identifier rubyid_service_id'>service_id</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="ServiceNotFound.html" title="StubRequests::ServiceNotFound (class)">ServiceNotFound</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_service_id'>service_id</span><span class='rparen'>)</span>
749
+ <span class='kw'>end</span></pre>
750
+ </td>
751
+ </tr>
752
+ </table>
753
+ </div>
754
+
755
+ <div class="method_details ">
756
+ <h3 class="signature " id="register_service-instance_method">
757
+
758
+ #<strong>register_service</strong>(service_id, service_uri) &#x21d2; <tt><span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span></tt>
759
+
760
+
761
+
762
+
763
+
764
+ </h3><div class="docstring">
765
+ <div class="discussion">
766
+ <p>Registers a service in the registry</p>
767
+
768
+
769
+ </div>
770
+ </div>
771
+ <div class="tags">
772
+ <p class="tag_title">Parameters:</p>
773
+ <ul class="param">
774
+
775
+ <li>
776
+
777
+ <span class='name'>service_id</span>
778
+
779
+
780
+ <span class='type'>(<tt>Symbol</tt>)</span>
781
+
782
+
783
+
784
+ &mdash;
785
+ <div class='inline'><p>a symbolic id of the service</p>
786
+ </div>
787
+
788
+ </li>
789
+
790
+ <li>
791
+
792
+ <span class='name'>service_uri</span>
793
+
794
+
795
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
796
+
797
+
798
+
799
+ &mdash;
800
+ <div class='inline'><p>a string with a base_uri to the service</p>
801
+ </div>
802
+
803
+ </li>
804
+
805
+ </ul>
806
+
807
+ <p class="tag_title">Returns:</p>
808
+ <ul class="return">
809
+
810
+ <li>
811
+
812
+
813
+ <span class='type'>(<tt><span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span></tt>)</span>
814
+
815
+
816
+
817
+ &mdash;
818
+ <div class='inline'><p>the service that was just registered</p>
819
+ </div>
820
+
821
+ </li>
822
+
823
+ </ul>
824
+ <p class="tag_title">Since:</p>
825
+ <ul class="since">
826
+
827
+ <li>
828
+
829
+
830
+
831
+
832
+
833
+ <div class='inline'><p>0.1.0</p>
834
+ </div>
835
+
836
+ </li>
837
+
838
+ </ul>
839
+
840
+ </div><table class="source_code">
841
+ <tr>
842
+ <td>
843
+ <pre class="lines">
844
+
845
+
846
+ 59
847
+ 60
848
+ 61
849
+ 62
850
+ 63
851
+ 64
852
+ 65</pre>
853
+ </td>
854
+ <td>
855
+ <pre class="code"><span class="info file"># File 'lib/stub_requests/service_registry.rb', line 59</span>
856
+
857
+ <span class='kw'>def</span> <span class='id identifier rubyid_register_service'>register_service</span><span class='lparen'>(</span><span class='id identifier rubyid_service_id'>service_id</span><span class='comma'>,</span> <span class='id identifier rubyid_service_uri'>service_uri</span><span class='rparen'>)</span>
858
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_service'>service</span> <span class='op'>=</span> <span class='id identifier rubyid_get_service'>get_service</span><span class='lparen'>(</span><span class='id identifier rubyid_service_id'>service_id</span><span class='rparen'>)</span><span class='rparen'>)</span>
859
+ <span class='const'><span class='object_link'><a href="../StubRequests.html" title="StubRequests (module)">StubRequests</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../StubRequests.html#logger-instance_method" title="StubRequests#logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Service already registered </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_service'>service</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
860
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="ServiceHaveEndpoints.html" title="StubRequests::ServiceHaveEndpoints (class)">ServiceHaveEndpoints</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_service'>service</span> <span class='kw'>if</span> <span class='id identifier rubyid_service'>service</span><span class='period'>.</span><span class='id identifier rubyid_endpoints?'>endpoints?</span>
861
+ <span class='kw'>end</span>
862
+ <span class='id identifier rubyid_services'>services</span><span class='lbracket'>[</span><span class='id identifier rubyid_service_id'>service_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Service.html#initialize-instance_method" title="StubRequests::Service#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_service_id'>service_id</span><span class='comma'>,</span> <span class='id identifier rubyid_service_uri'>service_uri</span><span class='rparen'>)</span>
863
+ <span class='kw'>end</span></pre>
864
+ </td>
865
+ </tr>
866
+ </table>
867
+ </div>
868
+
869
+ <div class="method_details ">
870
+ <h3 class="signature " id="remove_service-instance_method">
871
+
872
+ #<strong>remove_service</strong>(service_id) &#x21d2; <tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>
873
+
874
+
875
+
876
+
877
+
878
+ </h3><div class="docstring">
879
+ <div class="discussion">
880
+ <p>Removes a service from the registry</p>
881
+
882
+
883
+ </div>
884
+ </div>
885
+ <div class="tags">
886
+ <p class="tag_title">Parameters:</p>
887
+ <ul class="param">
888
+
889
+ <li>
890
+
891
+ <span class='name'>service_id</span>
892
+
893
+
894
+ <span class='type'>(<tt>Symbol</tt>)</span>
895
+
896
+
897
+
898
+ &mdash;
899
+ <div class='inline'><p>the service_id to remove</p>
900
+ </div>
901
+
902
+ </li>
903
+
904
+ </ul>
905
+
906
+ <p class="tag_title">Raises:</p>
907
+ <ul class="raise">
908
+
909
+ <li>
910
+
911
+
912
+ <span class='type'>(<tt><span class='object_link'><a href="ServiceNotFound.html" title="StubRequests::ServiceNotFound (class)">ServiceNotFound</a></span></tt>)</span>
913
+
914
+
915
+
916
+ &mdash;
917
+ <div class='inline'><p>when the service was not removed</p>
918
+ </div>
919
+
920
+ </li>
921
+
922
+ </ul>
923
+ <p class="tag_title">Since:</p>
924
+ <ul class="since">
925
+
926
+ <li>
927
+
928
+
929
+
930
+
931
+
932
+ <div class='inline'><p>0.1.0</p>
933
+ </div>
934
+
935
+ </li>
936
+
937
+ </ul>
938
+
939
+ </div><table class="source_code">
940
+ <tr>
941
+ <td>
942
+ <pre class="lines">
943
+
944
+
945
+ 75
946
+ 76
947
+ 77</pre>
948
+ </td>
949
+ <td>
950
+ <pre class="code"><span class="info file"># File 'lib/stub_requests/service_registry.rb', line 75</span>
951
+
952
+ <span class='kw'>def</span> <span class='id identifier rubyid_remove_service'>remove_service</span><span class='lparen'>(</span><span class='id identifier rubyid_service_id'>service_id</span><span class='rparen'>)</span>
953
+ <span class='id identifier rubyid_services'>services</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_service_id'>service_id</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="ServiceNotFound.html" title="StubRequests::ServiceNotFound (class)">ServiceNotFound</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_service_id'>service_id</span><span class='rparen'>)</span>
954
+ <span class='kw'>end</span></pre>
955
+ </td>
956
+ </tr>
957
+ </table>
958
+ </div>
959
+
960
+ <div class="method_details ">
961
+ <h3 class="signature " id="reset-instance_method">
962
+
963
+ #<strong>reset</strong> &#x21d2; <tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>
964
+
965
+
966
+
967
+
968
+
969
+ </h3><div class="docstring">
970
+ <div class="discussion">
971
+ <p class="note private">
972
+ <strong>This method is part of a private API.</strong>
973
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
974
+ </p>
975
+ <p>Resets the map with registered services</p>
976
+
977
+
978
+ </div>
979
+ </div>
980
+ <div class="tags">
981
+
982
+ <p class="tag_title">Since:</p>
983
+ <ul class="since">
984
+
985
+ <li>
986
+
987
+
988
+
989
+
990
+
991
+ <div class='inline'><p>0.1.0</p>
992
+ </div>
993
+
994
+ </li>
995
+
996
+ </ul>
997
+
998
+ </div><table class="source_code">
999
+ <tr>
1000
+ <td>
1001
+ <pre class="lines">
1002
+
1003
+
1004
+ 34
1005
+ 35
1006
+ 36</pre>
1007
+ </td>
1008
+ <td>
1009
+ <pre class="code"><span class="info file"># File 'lib/stub_requests/service_registry.rb', line 34</span>
1010
+
1011
+ <span class='kw'>def</span> <span class='id identifier rubyid_reset'>reset</span>
1012
+ <span class='id identifier rubyid_services'>services</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
1013
+ <span class='kw'>end</span></pre>
1014
+ </td>
1015
+ </tr>
1016
+ </table>
1017
+ </div>
1018
+
1019
+ </div>
1020
+
1021
+ </div>
1022
+
1023
+ <div id="footer">
1024
+ Generated on Fri Feb 1 19:57:30 2019 by
1025
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1026
+ 0.9.18 (ruby-2.5.3).
1027
+ </div>
1028
+
1029
+ </div>
1030
+ </body>
1031
+ </html>