stub_requests 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -2
  3. data/.reek.yml +1 -0
  4. data/.rubocop.yml +33 -35
  5. data/.simplecov +14 -8
  6. data/.yardopts +1 -1
  7. data/CHANGELOG.md +4 -1
  8. data/README.md +19 -11
  9. data/Rakefile +1 -3
  10. data/bin/update_docs.sh +16 -0
  11. data/gemfiles/webmock_2.3.gemfile.lock +1 -1
  12. data/gemfiles/webmock_3.5.gemfile.lock +1 -1
  13. data/gemfiles/webmock_develop.gemfile.lock +1 -1
  14. data/lib/rspec/subject_as_lambda.rb +138 -0
  15. data/lib/stub_requests/api.rb +42 -8
  16. data/lib/stub_requests/argument_validation.rb +17 -6
  17. data/lib/stub_requests/configuration.rb +21 -0
  18. data/lib/stub_requests/core_ext/all.rb +4 -0
  19. data/lib/stub_requests/core_ext/array/extract_options.rb +32 -0
  20. data/lib/stub_requests/core_ext/class/attribute.rb +61 -0
  21. data/lib/stub_requests/core_ext/kernel/singleton_class.rb +12 -0
  22. data/lib/stub_requests/core_ext/module/redefine_method.rb +44 -0
  23. data/lib/stub_requests/core_ext/object/blank.rb +99 -155
  24. data/lib/stub_requests/endpoint.rb +28 -30
  25. data/lib/stub_requests/endpoint_registry.rb +18 -16
  26. data/lib/stub_requests/exceptions.rb +84 -0
  27. data/lib/stub_requests/hash_util.rb +2 -0
  28. data/lib/stub_requests/metrics/endpoint_stat.rb +97 -0
  29. data/lib/stub_requests/metrics/registry.rb +132 -0
  30. data/lib/stub_requests/metrics/stub_stat.rb +80 -0
  31. data/lib/stub_requests/metrics.rb +32 -0
  32. data/lib/stub_requests/property/validator.rb +136 -0
  33. data/lib/stub_requests/property.rb +99 -0
  34. data/lib/stub_requests/service.rb +12 -53
  35. data/lib/stub_requests/service_registry.rb +8 -9
  36. data/lib/stub_requests/stub_requests.rb +23 -51
  37. data/lib/stub_requests/uri/builder.rb +5 -1
  38. data/lib/stub_requests/uri/scheme.rb +3 -1
  39. data/lib/stub_requests/uri/suffix.rb +5 -0
  40. data/lib/stub_requests/uri/validator.rb +3 -1
  41. data/lib/stub_requests/uri.rb +34 -0
  42. data/lib/stub_requests/version.rb +1 -1
  43. data/lib/stub_requests/webmock/builder.rb +116 -0
  44. data/lib/stub_requests/webmock/stub_registry_extension.rb +46 -0
  45. data/lib/stub_requests.rb +21 -3
  46. metadata +19 -49
  47. data/docs/.gitkeep +0 -0
  48. data/docs/Array.html +0 -137
  49. data/docs/FalseClass.html +0 -232
  50. data/docs/Hash.html +0 -137
  51. data/docs/NilClass.html +0 -232
  52. data/docs/Numeric.html +0 -233
  53. data/docs/Object.html +0 -396
  54. data/docs/String.html +0 -298
  55. data/docs/StubRequests/API.html +0 -651
  56. data/docs/StubRequests/ArgumentValidation.html +0 -309
  57. data/docs/StubRequests/Endpoint.html +0 -1187
  58. data/docs/StubRequests/EndpointNotFound.html +0 -157
  59. data/docs/StubRequests/EndpointRegistry.html +0 -1527
  60. data/docs/StubRequests/Error.html +0 -153
  61. data/docs/StubRequests/HashUtil.html +0 -304
  62. data/docs/StubRequests/InvalidType.html +0 -252
  63. data/docs/StubRequests/InvalidUri.html +0 -252
  64. data/docs/StubRequests/Service.html +0 -1307
  65. data/docs/StubRequests/ServiceHaveEndpoints.html +0 -244
  66. data/docs/StubRequests/ServiceNotFound.html +0 -252
  67. data/docs/StubRequests/ServiceRegistry.html +0 -1031
  68. data/docs/StubRequests/URI/Builder.html +0 -1194
  69. data/docs/StubRequests/URI/Scheme.html +0 -315
  70. data/docs/StubRequests/URI/Suffix.html +0 -315
  71. data/docs/StubRequests/URI/Validator.html +0 -770
  72. data/docs/StubRequests/URI.html +0 -144
  73. data/docs/StubRequests/UriSegmentMismatch.html +0 -157
  74. data/docs/StubRequests/WebMockBuilder.html +0 -887
  75. data/docs/StubRequests.html +0 -452
  76. data/docs/Time.html +0 -232
  77. data/docs/TrueClass.html +0 -232
  78. data/docs/_config.yml +0 -1
  79. data/docs/_index.html +0 -391
  80. data/docs/class_list.html +0 -51
  81. data/docs/css/common.css +0 -1
  82. data/docs/css/full_list.css +0 -58
  83. data/docs/css/style.css +0 -496
  84. data/docs/file.README.html +0 -225
  85. data/docs/file_list.html +0 -56
  86. data/docs/frames.html +0 -17
  87. data/docs/index.html +0 -225
  88. data/docs/js/app.js +0 -292
  89. data/docs/js/full_list.js +0 -216
  90. data/docs/js/jquery.js +0 -4
  91. data/docs/method_list.html +0 -707
  92. data/docs/top-level-namespace.html +0 -112
  93. data/lib/stub_requests/webmock_builder.rb +0 -108
@@ -1,651 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Module: StubRequests::API
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::API";
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 (A)</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">API</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>Module: StubRequests::API
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
-
70
-
71
-
72
- <dl>
73
- <dt>Extended by:</dt>
74
- <dd><span class='object_link'><a href="" title="StubRequests::API (module)">API</a></span></dd>
75
- </dl>
76
-
77
-
78
-
79
-
80
-
81
-
82
- <dl>
83
- <dt>Included in:</dt>
84
- <dd><span class='object_link'><a href="../StubRequests.html" title="StubRequests (module)">StubRequests</a></span>, <span class='object_link'><a href="" title="StubRequests::API (module)">API</a></span></dd>
85
- </dl>
86
-
87
-
88
-
89
- <dl>
90
- <dt>Defined in:</dt>
91
- <dd>lib/stub_requests/api.rb</dd>
92
- </dl>
93
-
94
- </div>
95
-
96
- <h2>Overview</h2><div class="docstring">
97
- <div class="discussion">
98
-
99
- <div class="note notetag">
100
- <strong>Note:</strong>
101
- <div class='inline'><p>This module can either be used by its class methods
102
- or included in say RSpec</p>
103
- </div>
104
- </div>
105
-
106
- <p>Module API abstraction to reduce the amount of WebMock.stub_request</p>
107
-
108
-
109
- </div>
110
- </div>
111
- <div class="tags">
112
-
113
- <p class="tag_title">Since:</p>
114
- <ul class="since">
115
-
116
- <li>
117
-
118
-
119
-
120
-
121
-
122
- <div class='inline'><p>0.1.0</p>
123
- </div>
124
-
125
- </li>
126
-
127
- </ul>
128
-
129
- </div>
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
- <h2>
138
- Class Method Summary
139
- <small><a href="#" class="summary_toggle">collapse</a></small>
140
- </h2>
141
-
142
- <ul class="summary">
143
-
144
- <li class="public ">
145
- <span class="summary_signature">
146
-
147
- <a href="#included-class_method" title="included (class method)">.<strong>included</strong>(base) &#x21d2; Object </a>
148
-
149
-
150
-
151
- </span>
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
- <span class="summary_desc"><div class='inline'><p>:nodoc:.</p>
162
- </div></span>
163
-
164
- </li>
165
-
166
-
167
- </ul>
168
-
169
- <h2>
170
- Instance Method Summary
171
- <small><a href="#" class="summary_toggle">collapse</a></small>
172
- </h2>
173
-
174
- <ul class="summary">
175
-
176
- <li class="public ">
177
- <span class="summary_signature">
178
-
179
- <a href="#register_service-instance_method" title="#register_service (instance method)">#<strong>register_service</strong>(service_id, service_uri, &amp;block) &#x21d2; Service </a>
180
-
181
-
182
-
183
- </span>
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
- <span class="summary_desc"><div class='inline'><p>Register a service in the service registry.</p>
194
- </div></span>
195
-
196
- </li>
197
-
198
-
199
- <li class="public ">
200
- <span class="summary_signature">
201
-
202
- <a href="#stub_endpoint-instance_method" title="#stub_endpoint (instance method)">#<strong>stub_endpoint</strong>(service_id, endpoint_id, uri_replacements = {}, options = {}, &amp;callback) &#x21d2; WebMock::RequestStub </a>
203
-
204
-
205
-
206
- </span>
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
- <span class="summary_desc"><div class='inline'><p>Stub a request to a registered service endpoint.</p>
217
- </div></span>
218
-
219
- </li>
220
-
221
-
222
- </ul>
223
-
224
-
225
-
226
-
227
- <div id="class_method_details" class="method_details_list">
228
- <h2>Class Method Details</h2>
229
-
230
-
231
- <div class="method_details first">
232
- <h3 class="signature first" id="included-class_method">
233
-
234
- .<strong>included</strong>(base) &#x21d2; <tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>
235
-
236
-
237
-
238
-
239
-
240
- </h3><div class="docstring">
241
- <div class="discussion">
242
- <p>:nodoc:</p>
243
-
244
-
245
- </div>
246
- </div>
247
- <div class="tags">
248
-
249
- <p class="tag_title">Since:</p>
250
- <ul class="since">
251
-
252
- <li>
253
-
254
-
255
-
256
-
257
-
258
- <div class='inline'><p>0.1.0</p>
259
- </div>
260
-
261
- </li>
262
-
263
- </ul>
264
-
265
- </div><table class="source_code">
266
- <tr>
267
- <td>
268
- <pre class="lines">
269
-
270
-
271
- 22
272
- 23
273
- 24</pre>
274
- </td>
275
- <td>
276
- <pre class="code"><span class="info file"># File 'lib/stub_requests/api.rb', line 22</span>
277
-
278
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
279
- <span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:extend</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span>
280
- <span class='kw'>end</span></pre>
281
- </td>
282
- </tr>
283
- </table>
284
- </div>
285
-
286
- </div>
287
-
288
- <div id="instance_method_details" class="method_details_list">
289
- <h2>Instance Method Details</h2>
290
-
291
-
292
- <div class="method_details first">
293
- <h3 class="signature first" id="register_service-instance_method">
294
-
295
- #<strong>register_service</strong>(service_id, service_uri, &amp;block) &#x21d2; <tt><span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span></tt>
296
-
297
-
298
-
299
-
300
-
301
- </h3><div class="docstring">
302
- <div class="discussion">
303
- <p>Register a service in the service registry</p>
304
-
305
- <p>:reek:UtilityFunction</p>
306
-
307
-
308
- </div>
309
- </div>
310
- <div class="tags">
311
- <p class="tag_title">Parameters:</p>
312
- <ul class="param">
313
-
314
- <li>
315
-
316
- <span class='name'>service_id</span>
317
-
318
-
319
- <span class='type'>(<tt>Symbol</tt>)</span>
320
-
321
-
322
-
323
- &mdash;
324
- <div class='inline'><p>a descriptive id for the service</p>
325
- </div>
326
-
327
- </li>
328
-
329
- <li>
330
-
331
- <span class='name'>service_uri</span>
332
-
333
-
334
- <span class='type'>(<tt>Symbol</tt>)</span>
335
-
336
-
337
-
338
- &mdash;
339
- <div class='inline'><p>the uri used to call the service</p>
340
- </div>
341
-
342
- </li>
343
-
344
- </ul>
345
-
346
- <p class="tag_title">Returns:</p>
347
- <ul class="return">
348
-
349
- <li>
350
-
351
-
352
- <span class='type'>(<tt><span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span></tt>)</span>
353
-
354
-
355
-
356
- &mdash;
357
- <div class='inline'><p>a new service or a previously registered service</p>
358
- </div>
359
-
360
- </li>
361
-
362
- </ul>
363
- <p class="tag_title">Since:</p>
364
- <ul class="since">
365
-
366
- <li>
367
-
368
-
369
-
370
-
371
-
372
- <div class='inline'><p>0.1.0</p>
373
- </div>
374
-
375
- </li>
376
-
377
- </ul>
378
-
379
- </div><table class="source_code">
380
- <tr>
381
- <td>
382
- <pre class="lines">
383
-
384
-
385
- 34
386
- 35
387
- 36
388
- 37
389
- 38</pre>
390
- </td>
391
- <td>
392
- <pre class="code"><span class="info file"># File 'lib/stub_requests/api.rb', line 34</span>
393
-
394
- <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='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
395
- <span class='id identifier rubyid_service'>service</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ServiceRegistry.html" title="StubRequests::ServiceRegistry (class)">ServiceRegistry</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</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>
396
- <span class='const'>Docile</span><span class='period'>.</span><span class='id identifier rubyid_dsl_eval'>dsl_eval</span><span class='lparen'>(</span><span class='id identifier rubyid_service'>service</span><span class='period'>.</span><span class='id identifier rubyid_endpoint_registry'>endpoint_registry</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
397
- <span class='id identifier rubyid_service'>service</span>
398
- <span class='kw'>end</span></pre>
399
- </td>
400
- </tr>
401
- </table>
402
- </div>
403
-
404
- <div class="method_details ">
405
- <h3 class="signature " id="stub_endpoint-instance_method">
406
-
407
- #<strong>stub_endpoint</strong>(service_id, endpoint_id, uri_replacements = {}, options = {}, &amp;callback) &#x21d2; <tt>WebMock::RequestStub</tt>
408
-
409
-
410
-
411
-
412
-
413
- </h3><div class="docstring">
414
- <div class="discussion">
415
- <p>Stub a request to a registered service endpoint</p>
416
-
417
- <p>:reek:UtilityFunction
418
- :reek:LongParameterList { max_params: 5 }</p>
419
-
420
-
421
- </div>
422
- </div>
423
- <div class="tags">
424
-
425
- <div class="examples">
426
- <p class="tag_title">Examples:</p>
427
-
428
-
429
- <p class="example_title"><div class='inline'><p>Stub a request to a registered service endpoint</p>
430
- </div></p>
431
-
432
- <pre class="example code"><code><span class='id identifier rubyid_register_stub'>register_stub</span><span class='lparen'>(</span>
433
- <span class='symbol'>:google_api</span><span class='comma'>,</span>
434
- <span class='symbol'>:get_map_location</span><span class='comma'>,</span>
435
- <span class='lbrace'>{</span> <span class='label'>request:</span> <span class='lbrace'>{</span> <span class='label'>headers:</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Accept</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span><span class='rbrace'>}</span><span class='rbrace'>}</span><span class='comma'>,</span>
436
- <span class='lbrace'>{</span> <span class='label'>response:</span> <span class='lbrace'>{</span> <span class='label'>body:</span> <span class='lbrace'>{</span> <span class='label'>id:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>abyasdjasd</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>successful</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span><span class='rbrace'>}</span><span class='rbrace'>}</span>
437
- <span class='rparen'>)</span></code></pre>
438
-
439
- </div>
440
- <p class="tag_title">Parameters:</p>
441
- <ul class="param">
442
-
443
- <li>
444
-
445
- <span class='name'>service_id</span>
446
-
447
-
448
- <span class='type'>(<tt>Symbol</tt>)</span>
449
-
450
-
451
-
452
- &mdash;
453
- <div class='inline'><p>the id of a registered service</p>
454
- </div>
455
-
456
- </li>
457
-
458
- <li>
459
-
460
- <span class='name'>endpoint_id</span>
461
-
462
-
463
- <span class='type'>(<tt>Symbol</tt>)</span>
464
-
465
-
466
-
467
- &mdash;
468
- <div class='inline'><p>the id of a registered endpoint</p>
469
- </div>
470
-
471
- </li>
472
-
473
- <li>
474
-
475
- <span class='name'>uri_replacements</span>
476
-
477
-
478
- <span class='type'>(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span>&lt;Symbol&gt;</tt>)</span>
479
-
480
-
481
- <em class="default">(defaults to: <tt>{}</tt>)</em>
482
-
483
-
484
- &mdash;
485
- <div class='inline'><p>a list of uri replacements</p>
486
- </div>
487
-
488
- </li>
489
-
490
- <li>
491
-
492
- <span class='name'>options</span>
493
-
494
-
495
- <span class='type'>(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span>&lt;Symbol&gt;</tt>)</span>
496
-
497
-
498
- <em class="default">(defaults to: <tt>{}</tt>)</em>
499
-
500
-
501
- </li>
502
-
503
- </ul>
504
-
505
-
506
-
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
- <p class="tag_title">Options Hash (<tt>options</tt>):</p>
515
- <ul class="option">
516
-
517
- <li>
518
- <span class="name">:request</span>
519
- <span class="type">(<tt>optional</tt>, <tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span>&lt;Symbol&gt;</tt>)</span>
520
- <span class="default">
521
-
522
- </span>
523
-
524
- &mdash; <div class='inline'><p>webmock request options</p>
525
- </div>
526
-
527
- </li>
528
-
529
- <li>
530
- <span class="name">:response</span>
531
- <span class="type">(<tt>optional</tt>, <tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span>&lt;Symbol&gt;</tt>)</span>
532
- <span class="default">
533
-
534
- </span>
535
-
536
- &mdash; <div class='inline'><p>webmock response options</p>
537
- </div>
538
-
539
- </li>
540
-
541
- <li>
542
- <span class="name">:error</span>
543
- <span class="type">(<tt>optional</tt>, <tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span></tt>, <tt>Exception</tt>, <tt>StandardError</tt>, <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
544
- <span class="default">
545
-
546
- </span>
547
-
548
- &mdash; <div class='inline'><p>webmock error to raise</p>
549
- </div>
550
-
551
- </li>
552
-
553
- <li>
554
- <span class="name">:timeout</span>
555
- <span class="type">(<tt>optional</tt>, <tt><span class='object_link'><a href="../TrueClass.html" title="TrueClass (class)">TrueClass</a></span></tt>)</span>
556
- <span class="default">
557
-
558
- </span>
559
-
560
- &mdash; <div class='inline'><p>set to truthy to raise timeeout with webmock</p>
561
- </div>
562
-
563
- </li>
564
-
565
- </ul>
566
-
567
-
568
-
569
-
570
- <p class="tag_title">Returns:</p>
571
- <ul class="return">
572
-
573
- <li>
574
-
575
-
576
- <span class='type'>(<tt>WebMock::RequestStub</tt>)</span>
577
-
578
-
579
-
580
- &mdash;
581
- <div class='inline'><p>a mocked request</p>
582
- </div>
583
-
584
- </li>
585
-
586
- </ul>
587
-
588
- <p class="tag_title">See Also:</p>
589
- <ul class="see">
590
-
591
- <li>#stub_http_request</li>
592
-
593
- </ul>
594
- <p class="tag_title">Since:</p>
595
- <ul class="since">
596
-
597
- <li>
598
-
599
-
600
-
601
-
602
-
603
- <div class='inline'><p>0.1.0</p>
604
- </div>
605
-
606
- </li>
607
-
608
- </ul>
609
-
610
- </div><table class="source_code">
611
- <tr>
612
- <td>
613
- <pre class="lines">
614
-
615
-
616
- 65
617
- 66
618
- 67
619
- 68
620
- 69
621
- 70
622
- 71</pre>
623
- </td>
624
- <td>
625
- <pre class="code"><span class="info file"># File 'lib/stub_requests/api.rb', line 65</span>
626
-
627
- <span class='kw'>def</span> <span class='id identifier rubyid_stub_endpoint'>stub_endpoint</span><span class='lparen'>(</span><span class='id identifier rubyid_service_id'>service_id</span><span class='comma'>,</span> <span class='id identifier rubyid_endpoint_id'>endpoint_id</span><span class='comma'>,</span> <span class='id identifier rubyid_uri_replacements'>uri_replacements</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_callback'>callback</span><span class='rparen'>)</span>
628
- <span class='id identifier rubyid_service'>service</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ServiceRegistry.html" title="StubRequests::ServiceRegistry (class)">ServiceRegistry</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</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>
629
- <span class='id identifier rubyid_endpoint'>endpoint</span> <span class='op'>=</span> <span class='id identifier rubyid_service'>service</span><span class='period'>.</span><span class='id identifier rubyid_get_endpoint!'>get_endpoint!</span><span class='lparen'>(</span><span class='id identifier rubyid_endpoint_id'>endpoint_id</span><span class='rparen'>)</span>
630
- <span class='id identifier rubyid_uri'>uri</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="URI.html" title="StubRequests::URI (module)">URI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="URI/Builder.html" title="StubRequests::URI::Builder (class)">Builder</a></span></span><span class='period'>.</span><span class='id identifier rubyid_build'><span class='object_link'><a href="URI/Builder.html#build-class_method" title="StubRequests::URI::Builder.build (method)">build</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_service'>service</span><span class='period'>.</span><span class='id identifier rubyid_uri'>uri</span><span class='comma'>,</span> <span class='id identifier rubyid_endpoint'>endpoint</span><span class='period'>.</span><span class='id identifier rubyid_uri_template'>uri_template</span><span class='comma'>,</span> <span class='id identifier rubyid_uri_replacements'>uri_replacements</span><span class='rparen'>)</span>
631
-
632
- <span class='const'><span class='object_link'><a href="../StubRequests.html" title="StubRequests (module)">StubRequests</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="WebMockBuilder.html" title="StubRequests::WebMockBuilder (class)">WebMockBuilder</a></span></span><span class='period'>.</span><span class='id identifier rubyid_build'><span class='object_link'><a href="WebMockBuilder.html#build-class_method" title="StubRequests::WebMockBuilder.build (method)">build</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_endpoint'>endpoint</span><span class='period'>.</span><span class='id identifier rubyid_verb'>verb</span><span class='comma'>,</span> <span class='id identifier rubyid_uri'>uri</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_callback'>callback</span><span class='rparen'>)</span>
633
- <span class='kw'>end</span></pre>
634
- </td>
635
- </tr>
636
- </table>
637
- </div>
638
-
639
- </div>
640
-
641
- </div>
642
-
643
- <div id="footer">
644
- Generated on Fri Feb 1 19:57:29 2019 by
645
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
646
- 0.9.18 (ruby-2.5.3).
647
- </div>
648
-
649
- </div>
650
- </body>
651
- </html>