simple-service 0.1.4

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 (69) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rubocop.yml +100 -0
  4. data/.tm_properties +1 -0
  5. data/Gemfile +14 -0
  6. data/Makefile +9 -0
  7. data/README.md +68 -0
  8. data/Rakefile +6 -0
  9. data/VERSION +1 -0
  10. data/bin/bundle +105 -0
  11. data/bin/console +15 -0
  12. data/bin/rake +29 -0
  13. data/bin/rspec +29 -0
  14. data/doc/Simple.html +117 -0
  15. data/doc/Simple/Service.html +863 -0
  16. data/doc/Simple/Service/Action.html +1014 -0
  17. data/doc/Simple/Service/Action/Comment.html +451 -0
  18. data/doc/Simple/Service/Action/Comment/Extractor.html +347 -0
  19. data/doc/Simple/Service/Action/IndieHash.html +506 -0
  20. data/doc/Simple/Service/Action/MethodReflection.html +285 -0
  21. data/doc/Simple/Service/Action/Parameter.html +816 -0
  22. data/doc/Simple/Service/ArgumentError.html +128 -0
  23. data/doc/Simple/Service/ClassMethods.html +187 -0
  24. data/doc/Simple/Service/Context.html +379 -0
  25. data/doc/Simple/Service/ContextMissingError.html +124 -0
  26. data/doc/Simple/Service/ContextReadOnlyError.html +206 -0
  27. data/doc/Simple/Service/ExtraArguments.html +428 -0
  28. data/doc/Simple/Service/GemHelper.html +190 -0
  29. data/doc/Simple/Service/MissingArguments.html +426 -0
  30. data/doc/Simple/Service/NoSuchAction.html +433 -0
  31. data/doc/_index.html +286 -0
  32. data/doc/class_list.html +51 -0
  33. data/doc/css/common.css +1 -0
  34. data/doc/css/full_list.css +58 -0
  35. data/doc/css/style.css +496 -0
  36. data/doc/file.README.html +146 -0
  37. data/doc/file_list.html +56 -0
  38. data/doc/frames.html +17 -0
  39. data/doc/index.html +146 -0
  40. data/doc/js/app.js +303 -0
  41. data/doc/js/full_list.js +216 -0
  42. data/doc/js/jquery.js +4 -0
  43. data/doc/method_list.html +539 -0
  44. data/doc/top-level-namespace.html +110 -0
  45. data/lib/simple-service.rb +3 -0
  46. data/lib/simple/service.rb +143 -0
  47. data/lib/simple/service/action.rb +203 -0
  48. data/lib/simple/service/action/comment.rb +57 -0
  49. data/lib/simple/service/action/indie_hash.rb +37 -0
  50. data/lib/simple/service/action/method_reflection.rb +70 -0
  51. data/lib/simple/service/action/parameter.rb +42 -0
  52. data/lib/simple/service/context.rb +94 -0
  53. data/lib/simple/service/errors.rb +54 -0
  54. data/lib/simple/service/version.rb +29 -0
  55. data/log/.gitkeep +0 -0
  56. data/scripts/release +2 -0
  57. data/scripts/release.rb +91 -0
  58. data/scripts/stats +5 -0
  59. data/scripts/watch +2 -0
  60. data/simple-service.gemspec +25 -0
  61. data/spec/simple/service/action_invoke2_spec.rb +166 -0
  62. data/spec/simple/service/action_invoke_spec.rb +266 -0
  63. data/spec/simple/service/action_spec.rb +51 -0
  64. data/spec/simple/service/context_spec.rb +69 -0
  65. data/spec/simple/service/service_spec.rb +105 -0
  66. data/spec/simple/service/version_spec.rb +7 -0
  67. data/spec/spec_helper.rb +38 -0
  68. data/spec/support/spec_services.rb +50 -0
  69. metadata +130 -0
@@ -0,0 +1,1014 @@
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: Simple::Service::Action
8
+
9
+ &mdash; Documentation by YARD 0.9.20
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 = "Simple::Service::Action";
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="../../Simple.html" title="Simple (module)">Simple</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Service.html" title="Simple::Service (module)">Service</a></span></span>
41
+ &raquo;
42
+ <span class="title">Action</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: Simple::Service::Action
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Simple::Service::Action</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/simple/service/action.rb<span class="defines">,<br />
98
+ lib/simple/service/action.rb,<br /> lib/simple/service/action/indie_hash.rb</span>
99
+ </dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>rubocop:disable Metrics/AbcSize rubocop:disable Metrics/PerceivedComplexity rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Style/GuardClause rubocop:disable Metrics/ClassLength</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div><h2>Defined Under Namespace</h2>
116
+ <p class="children">
117
+
118
+
119
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Action/MethodReflection.html" title="Simple::Service::Action::MethodReflection (module)">MethodReflection</a></span>
120
+
121
+
122
+
123
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Action/Comment.html" title="Simple::Service::Action::Comment (class)">Comment</a></span>, <span class='object_link'><a href="Action/IndieHash.html" title="Simple::Service::Action::IndieHash (class)">IndieHash</a></span>, <span class='object_link'><a href="Action/Parameter.html" title="Simple::Service::Action::Parameter (class)">Parameter</a></span>
124
+
125
+
126
+ </p>
127
+
128
+
129
+ <h2>
130
+ Constant Summary
131
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
132
+ </h2>
133
+
134
+ <dl class="constants">
135
+
136
+ <dt id="IDENTIFIER_PATTERN-constant" class="">IDENTIFIER_PATTERN =
137
+
138
+ </dt>
139
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[a-z][a-z0-9_]*</span><span class='tstring_end'>&quot;</span></span></pre></dd>
140
+
141
+ <dt id="IDENTIFIER_REGEXP-constant" class="">IDENTIFIER_REGEXP =
142
+
143
+ </dt>
144
+ <dd><pre class="code"><span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_compile'>compile</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\\A</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#IDENTIFIER_PATTERN-constant" title="Simple::Service::Action::IDENTIFIER_PATTERN (constant)">IDENTIFIER_PATTERN</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>\\z</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span></pre></dd>
145
+
146
+ </dl>
147
+
148
+
149
+
150
+
151
+
152
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
153
+ <ul class="summary">
154
+
155
+ <li class="public ">
156
+ <span class="summary_signature">
157
+
158
+ <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Object </a>
159
+
160
+
161
+
162
+ </span>
163
+
164
+
165
+
166
+
167
+ <span class="note title readonly">readonly</span>
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+ <span class="summary_desc"><div class='inline'>
178
+ <p>Returns the value of attribute name.</p>
179
+ </div></span>
180
+
181
+ </li>
182
+
183
+
184
+ <li class="public ">
185
+ <span class="summary_signature">
186
+
187
+ <a href="#service-instance_method" title="#service (instance method)">#<strong>service</strong> &#x21d2; Object </a>
188
+
189
+
190
+
191
+ </span>
192
+
193
+
194
+
195
+
196
+ <span class="note title readonly">readonly</span>
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ <span class="summary_desc"><div class='inline'>
207
+ <p>Returns the value of attribute service.</p>
208
+ </div></span>
209
+
210
+ </li>
211
+
212
+
213
+ </ul>
214
+
215
+
216
+
217
+
218
+
219
+ <h2>
220
+ Class Method Summary
221
+ <small><a href="#" class="summary_toggle">collapse</a></small>
222
+ </h2>
223
+
224
+ <ul class="summary">
225
+
226
+ <li class="public ">
227
+ <span class="summary_signature">
228
+
229
+ <a href="#enumerate-class_method" title="enumerate (class method)">.<strong>enumerate</strong>(service:) &#x21d2; Object </a>
230
+
231
+
232
+
233
+ </span>
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+ <span class="summary_desc"><div class='inline'>
244
+ <p>determines all services provided by the <code>service</code> service module.</p>
245
+ </div></span>
246
+
247
+ </li>
248
+
249
+
250
+ </ul>
251
+
252
+ <h2>
253
+ Instance Method Summary
254
+ <small><a href="#" class="summary_toggle">collapse</a></small>
255
+ </h2>
256
+
257
+ <ul class="summary">
258
+
259
+ <li class="public ">
260
+ <span class="summary_signature">
261
+
262
+ <a href="#full_description-instance_method" title="#full_description (instance method)">#<strong>full_description</strong> &#x21d2; Object </a>
263
+
264
+
265
+
266
+ </span>
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+ <span class="summary_desc"><div class='inline'></div></span>
277
+
278
+ </li>
279
+
280
+
281
+ <li class="public ">
282
+ <span class="summary_signature">
283
+
284
+ <a href="#full_name-instance_method" title="#full_name (instance method)">#<strong>full_name</strong> &#x21d2; Object </a>
285
+
286
+
287
+
288
+ </span>
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+ <span class="summary_desc"><div class='inline'></div></span>
299
+
300
+ </li>
301
+
302
+
303
+ <li class="public ">
304
+ <span class="summary_signature">
305
+
306
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(service, name) &#x21d2; Action </a>
307
+
308
+
309
+
310
+ </span>
311
+
312
+
313
+ <span class="note title constructor">constructor</span>
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+ <span class="summary_desc"><div class='inline'>
323
+ <p>A new instance of Action.</p>
324
+ </div></span>
325
+
326
+ </li>
327
+
328
+
329
+ <li class="public ">
330
+ <span class="summary_signature">
331
+
332
+ <a href="#invoke-instance_method" title="#invoke (instance method)">#<strong>invoke</strong>(*args, **named_args) &#x21d2; Object </a>
333
+
334
+
335
+
336
+ </span>
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+ <span class="summary_desc"><div class='inline'>
347
+ <p>build a service_instance and run the action, with arguments constructed from args_hsh and params_hsh.</p>
348
+ </div></span>
349
+
350
+ </li>
351
+
352
+
353
+ <li class="public ">
354
+ <span class="summary_signature">
355
+
356
+ <a href="#invoke2-instance_method" title="#invoke2 (instance method)">#<strong>invoke2</strong>(args:, flags:) &#x21d2; Object </a>
357
+
358
+
359
+
360
+ </span>
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+ <span class="summary_desc"><div class='inline'>
371
+ <p>invokes an action with a given <code>name</code> in a service with a Hash of arguments.</p>
372
+ </div></span>
373
+
374
+ </li>
375
+
376
+
377
+ <li class="public ">
378
+ <span class="summary_signature">
379
+
380
+ <a href="#parameters-instance_method" title="#parameters (instance method)">#<strong>parameters</strong> &#x21d2; Object </a>
381
+
382
+
383
+
384
+ </span>
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+ <span class="summary_desc"><div class='inline'>
395
+ <p>returns an Array of Parameter structures.</p>
396
+ </div></span>
397
+
398
+ </li>
399
+
400
+
401
+ <li class="public ">
402
+ <span class="summary_signature">
403
+
404
+ <a href="#short_description-instance_method" title="#short_description (instance method)">#<strong>short_description</strong> &#x21d2; Object </a>
405
+
406
+
407
+
408
+ </span>
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+ <span class="summary_desc"><div class='inline'></div></span>
419
+
420
+ </li>
421
+
422
+
423
+ <li class="public ">
424
+ <span class="summary_signature">
425
+
426
+ <a href="#source_location-instance_method" title="#source_location (instance method)">#<strong>source_location</strong> &#x21d2; Object </a>
427
+
428
+
429
+
430
+ </span>
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+ <span class="summary_desc"><div class='inline'></div></span>
441
+
442
+ </li>
443
+
444
+
445
+ <li class="public ">
446
+ <span class="summary_signature">
447
+
448
+ <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> &#x21d2; Object </a>
449
+
450
+
451
+
452
+ </span>
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+ <span class="summary_desc"><div class='inline'></div></span>
463
+
464
+ </li>
465
+
466
+
467
+ </ul>
468
+
469
+
470
+ <div id="constructor_details" class="method_details_list">
471
+ <h2>Constructor Details</h2>
472
+
473
+ <div class="method_details first">
474
+ <h3 class="signature first" id="initialize-instance_method">
475
+
476
+ #<strong>initialize</strong>(service, name) &#x21d2; <tt><span class='object_link'><a href="" title="Simple::Service::Action (class)">Action</a></span></tt>
477
+
478
+
479
+
480
+
481
+
482
+ </h3><div class="docstring">
483
+ <div class="discussion">
484
+
485
+ <p>Returns a new instance of Action</p>
486
+
487
+
488
+ </div>
489
+ </div>
490
+ <div class="tags">
491
+
492
+
493
+ </div><table class="source_code">
494
+ <tr>
495
+ <td>
496
+ <pre class="lines">
497
+
498
+
499
+ 44
500
+ 45
501
+ 46
502
+ 47
503
+ 48
504
+ 49</pre>
505
+ </td>
506
+ <td>
507
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 44</span>
508
+
509
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_service'>service</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='comment'># @private
510
+ </span> <span class='ivar'>@service</span> <span class='op'>=</span> <span class='id identifier rubyid_service'>service</span>
511
+ <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
512
+
513
+ <span class='id identifier rubyid_parameters'>parameters</span>
514
+ <span class='kw'>end</span></pre>
515
+ </td>
516
+ </tr>
517
+ </table>
518
+ </div>
519
+
520
+ </div>
521
+
522
+ <div id="instance_attr_details" class="attr_details">
523
+ <h2>Instance Attribute Details</h2>
524
+
525
+
526
+ <span id=""></span>
527
+ <div class="method_details first">
528
+ <h3 class="signature first" id="name-instance_method">
529
+
530
+ #<strong>name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
531
+
532
+
533
+
534
+
535
+
536
+ </h3><div class="docstring">
537
+ <div class="discussion">
538
+
539
+ <p>Returns the value of attribute name</p>
540
+
541
+
542
+ </div>
543
+ </div>
544
+ <div class="tags">
545
+
546
+
547
+ </div><table class="source_code">
548
+ <tr>
549
+ <td>
550
+ <pre class="lines">
551
+
552
+
553
+ 29
554
+ 30
555
+ 31</pre>
556
+ </td>
557
+ <td>
558
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 29</span>
559
+
560
+ <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
561
+ <span class='ivar'>@name</span>
562
+ <span class='kw'>end</span></pre>
563
+ </td>
564
+ </tr>
565
+ </table>
566
+ </div>
567
+
568
+
569
+ <span id=""></span>
570
+ <div class="method_details ">
571
+ <h3 class="signature " id="service-instance_method">
572
+
573
+ #<strong>service</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
574
+
575
+
576
+
577
+
578
+
579
+ </h3><div class="docstring">
580
+ <div class="discussion">
581
+
582
+ <p>Returns the value of attribute service</p>
583
+
584
+
585
+ </div>
586
+ </div>
587
+ <div class="tags">
588
+
589
+
590
+ </div><table class="source_code">
591
+ <tr>
592
+ <td>
593
+ <pre class="lines">
594
+
595
+
596
+ 28
597
+ 29
598
+ 30</pre>
599
+ </td>
600
+ <td>
601
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 28</span>
602
+
603
+ <span class='kw'>def</span> <span class='id identifier rubyid_service'>service</span>
604
+ <span class='ivar'>@service</span>
605
+ <span class='kw'>end</span></pre>
606
+ </td>
607
+ </tr>
608
+ </table>
609
+ </div>
610
+
611
+ </div>
612
+
613
+
614
+ <div id="class_method_details" class="method_details_list">
615
+ <h2>Class Method Details</h2>
616
+
617
+
618
+ <div class="method_details first">
619
+ <h3 class="signature first" id="enumerate-class_method">
620
+
621
+ .<strong>enumerate</strong>(service:) &#x21d2; <tt>Object</tt>
622
+
623
+
624
+
625
+
626
+
627
+ </h3><div class="docstring">
628
+ <div class="discussion">
629
+
630
+ <p>determines all services provided by the <code>service</code> service module.</p>
631
+
632
+
633
+ </div>
634
+ </div>
635
+ <div class="tags">
636
+
637
+
638
+ </div><table class="source_code">
639
+ <tr>
640
+ <td>
641
+ <pre class="lines">
642
+
643
+
644
+ 22
645
+ 23
646
+ 24
647
+ 25
648
+ 26</pre>
649
+ </td>
650
+ <td>
651
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 22</span>
652
+
653
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_enumerate'>enumerate</span><span class='lparen'>(</span><span class='label'>service:</span><span class='rparen'>)</span> <span class='comment'># @private
654
+ </span> <span class='id identifier rubyid_service'>service</span><span class='period'>.</span><span class='id identifier rubyid_public_instance_methods'>public_instance_methods</span><span class='lparen'>(</span><span class='kw'>false</span><span class='rparen'>)</span>
655
+ <span class='period'>.</span><span class='id identifier rubyid_grep'>grep</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#IDENTIFIER_REGEXP-constant" title="Simple::Service::Action::IDENTIFIER_REGEXP (constant)">IDENTIFIER_REGEXP</a></span></span><span class='rparen'>)</span>
656
+ <span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_hsh'>hsh</span><span class='op'>|</span> <span class='id identifier rubyid_hsh'>hsh</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Simple::Service::Action (class)">Action</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Simple::Service::Action#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_service'>service</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
657
+ <span class='kw'>end</span></pre>
658
+ </td>
659
+ </tr>
660
+ </table>
661
+ </div>
662
+
663
+ </div>
664
+
665
+ <div id="instance_method_details" class="method_details_list">
666
+ <h2>Instance Method Details</h2>
667
+
668
+
669
+ <div class="method_details first">
670
+ <h3 class="signature first" id="full_description-instance_method">
671
+
672
+ #<strong>full_description</strong> &#x21d2; <tt>Object</tt>
673
+
674
+
675
+
676
+
677
+
678
+ </h3><table class="source_code">
679
+ <tr>
680
+ <td>
681
+ <pre class="lines">
682
+
683
+
684
+ 55
685
+ 56
686
+ 57</pre>
687
+ </td>
688
+ <td>
689
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 55</span>
690
+
691
+ <span class='kw'>def</span> <span class='id identifier rubyid_full_description'>full_description</span>
692
+ <span class='id identifier rubyid_comment'>comment</span><span class='period'>.</span><span class='id identifier rubyid_full'>full</span>
693
+ <span class='kw'>end</span></pre>
694
+ </td>
695
+ </tr>
696
+ </table>
697
+ </div>
698
+
699
+ <div class="method_details ">
700
+ <h3 class="signature " id="full_name-instance_method">
701
+
702
+ #<strong>full_name</strong> &#x21d2; <tt>Object</tt>
703
+
704
+
705
+
706
+
707
+
708
+ </h3><table class="source_code">
709
+ <tr>
710
+ <td>
711
+ <pre class="lines">
712
+
713
+
714
+ 31
715
+ 32
716
+ 33</pre>
717
+ </td>
718
+ <td>
719
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 31</span>
720
+
721
+ <span class='kw'>def</span> <span class='id identifier rubyid_full_name'>full_name</span>
722
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_service'>service</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>#</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
723
+ <span class='kw'>end</span></pre>
724
+ </td>
725
+ </tr>
726
+ </table>
727
+ </div>
728
+
729
+ <div class="method_details ">
730
+ <h3 class="signature " id="invoke-instance_method">
731
+
732
+ #<strong>invoke</strong>(*args, **named_args) &#x21d2; <tt>Object</tt>
733
+
734
+
735
+
736
+
737
+
738
+ </h3><div class="docstring">
739
+ <div class="discussion">
740
+
741
+ <p>build a service_instance and run the action, with arguments constructed from args_hsh and params_hsh.</p>
742
+
743
+
744
+ </div>
745
+ </div>
746
+ <div class="tags">
747
+
748
+
749
+ </div><table class="source_code">
750
+ <tr>
751
+ <td>
752
+ <pre class="lines">
753
+
754
+
755
+ 76
756
+ 77
757
+ 78
758
+ 79
759
+ 80
760
+ 81
761
+ 82
762
+ 83
763
+ 84
764
+ 85
765
+ 86
766
+ 87</pre>
767
+ </td>
768
+ <td>
769
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 76</span>
770
+
771
+ <span class='kw'>def</span> <span class='id identifier rubyid_invoke'>invoke</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_named_args'>named_args</span><span class='rparen'>)</span>
772
+ <span class='comment'># convert Array arguments into a Hash of named arguments. This is strictly
773
+ </span> <span class='comment'># necessary to be able to apply default value-based type conversions. (On
774
+ </span> <span class='comment'># the downside this also means we convert an array to a hash and then back
775
+ </span> <span class='comment'># into an array. This, however, should only be an issue for CLI based action
776
+ </span> <span class='comment'># invocations, because any other use case (that I can think of) should allow
777
+ </span> <span class='comment'># us to provide arguments as a Hash.
778
+ </span> <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='id identifier rubyid_convert_argument_array_to_hash'>convert_argument_array_to_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
779
+ <span class='id identifier rubyid_named_args'>named_args</span> <span class='op'>=</span> <span class='id identifier rubyid_named_args'>named_args</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
780
+
781
+ <span class='id identifier rubyid_invoke2'>invoke2</span><span class='lparen'>(</span><span class='label'>args:</span> <span class='id identifier rubyid_named_args'>named_args</span><span class='comma'>,</span> <span class='label'>flags:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
782
+ <span class='kw'>end</span></pre>
783
+ </td>
784
+ </tr>
785
+ </table>
786
+ </div>
787
+
788
+ <div class="method_details ">
789
+ <h3 class="signature " id="invoke2-instance_method">
790
+
791
+ #<strong>invoke2</strong>(args:, flags:) &#x21d2; <tt>Object</tt>
792
+
793
+
794
+
795
+
796
+
797
+ </h3><div class="docstring">
798
+ <div class="discussion">
799
+
800
+ <p>invokes an action with a given <code>name</code> in a service with a Hash of arguments.</p>
801
+
802
+ <p>You cannot call this method if the context is not set.</p>
803
+
804
+
805
+ </div>
806
+ </div>
807
+ <div class="tags">
808
+
809
+
810
+ </div><table class="source_code">
811
+ <tr>
812
+ <td>
813
+ <pre class="lines">
814
+
815
+
816
+ 92
817
+ 93
818
+ 94
819
+ 95
820
+ 96
821
+ 97
822
+ 98
823
+ 99
824
+ 100
825
+ 101
826
+ 102
827
+ 103
828
+ 104
829
+ 105
830
+ 106
831
+ 107
832
+ 108
833
+ 109
834
+ 110
835
+ 111
836
+ 112
837
+ 113
838
+ 114</pre>
839
+ </td>
840
+ <td>
841
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 92</span>
842
+
843
+ <span class='kw'>def</span> <span class='id identifier rubyid_invoke2'>invoke2</span><span class='lparen'>(</span><span class='label'>args:</span><span class='comma'>,</span> <span class='label'>flags:</span><span class='rparen'>)</span>
844
+ <span class='comment'># args and flags are being stringified. This is necessary to not allow any
845
+ </span> <span class='comment'># unchecked input to DOS this process by just providing always changing
846
+ </span> <span class='comment'># key values.
847
+ </span> <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Action/IndieHash.html" title="Simple::Service::Action::IndieHash (class)">IndieHash</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Action/IndieHash.html#initialize-instance_method" title="Simple::Service::Action::IndieHash#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
848
+ <span class='id identifier rubyid_flags'>flags</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Action/IndieHash.html" title="Simple::Service::Action::IndieHash (class)">IndieHash</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Action/IndieHash.html#initialize-instance_method" title="Simple::Service::Action::IndieHash#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_flags'>flags</span><span class='rparen'>)</span>
849
+
850
+ <span class='id identifier rubyid_verify_required_args!'>verify_required_args!</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='id identifier rubyid_flags'>flags</span><span class='rparen'>)</span>
851
+
852
+ <span class='id identifier rubyid_positionals'>positionals</span> <span class='op'>=</span> <span class='id identifier rubyid_build_positional_arguments'>build_positional_arguments</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='id identifier rubyid_flags'>flags</span><span class='rparen'>)</span>
853
+ <span class='id identifier rubyid_keywords'>keywords</span> <span class='op'>=</span> <span class='id identifier rubyid_build_keyword_arguments'>build_keyword_arguments</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_flags'>flags</span><span class='rparen'>)</span><span class='rparen'>)</span>
854
+
855
+ <span class='id identifier rubyid_service_instance'>service_instance</span> <span class='op'>=</span> <span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
856
+ <span class='id identifier rubyid_service_instance'>service_instance</span><span class='period'>.</span><span class='id identifier rubyid_extend'>extend</span> <span class='id identifier rubyid_service'>service</span>
857
+
858
+ <span class='kw'>if</span> <span class='id identifier rubyid_keywords'>keywords</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
859
+ <span class='id identifier rubyid_service_instance'>service_instance</span><span class='period'>.</span><span class='id identifier rubyid_public_send'>public_send</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_positionals'>positionals</span><span class='rparen'>)</span>
860
+ <span class='kw'>else</span>
861
+ <span class='comment'># calling this with an empty keywords Hash still raises an ArgumentError
862
+ </span> <span class='comment'># if the target method does not accept arguments.
863
+ </span> <span class='id identifier rubyid_service_instance'>service_instance</span><span class='period'>.</span><span class='id identifier rubyid_public_send'>public_send</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_positionals'>positionals</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_keywords'>keywords</span><span class='rparen'>)</span>
864
+ <span class='kw'>end</span>
865
+ <span class='kw'>end</span></pre>
866
+ </td>
867
+ </tr>
868
+ </table>
869
+ </div>
870
+
871
+ <div class="method_details ">
872
+ <h3 class="signature " id="parameters-instance_method">
873
+
874
+ #<strong>parameters</strong> &#x21d2; <tt>Object</tt>
875
+
876
+
877
+
878
+
879
+
880
+ </h3><div class="docstring">
881
+ <div class="discussion">
882
+
883
+ <p>returns an Array of Parameter structures.</p>
884
+
885
+
886
+ </div>
887
+ </div>
888
+ <div class="tags">
889
+
890
+
891
+ </div><table class="source_code">
892
+ <tr>
893
+ <td>
894
+ <pre class="lines">
895
+
896
+
897
+ 40
898
+ 41
899
+ 42</pre>
900
+ </td>
901
+ <td>
902
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 40</span>
903
+
904
+ <span class='kw'>def</span> <span class='id identifier rubyid_parameters'>parameters</span>
905
+ <span class='ivar'>@parameters</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Action/Parameter.html" title="Simple::Service::Action::Parameter (class)">Parameter</a></span></span><span class='period'>.</span><span class='id identifier rubyid_reflect_on_method'><span class='object_link'><a href="Action/Parameter.html#reflect_on_method-class_method" title="Simple::Service::Action::Parameter.reflect_on_method (method)">reflect_on_method</a></span></span><span class='lparen'>(</span><span class='label'>service:</span> <span class='id identifier rubyid_service'>service</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
906
+ <span class='kw'>end</span></pre>
907
+ </td>
908
+ </tr>
909
+ </table>
910
+ </div>
911
+
912
+ <div class="method_details ">
913
+ <h3 class="signature " id="short_description-instance_method">
914
+
915
+ #<strong>short_description</strong> &#x21d2; <tt>Object</tt>
916
+
917
+
918
+
919
+
920
+
921
+ </h3><table class="source_code">
922
+ <tr>
923
+ <td>
924
+ <pre class="lines">
925
+
926
+
927
+ 51
928
+ 52
929
+ 53</pre>
930
+ </td>
931
+ <td>
932
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 51</span>
933
+
934
+ <span class='kw'>def</span> <span class='id identifier rubyid_short_description'>short_description</span>
935
+ <span class='id identifier rubyid_comment'>comment</span><span class='period'>.</span><span class='id identifier rubyid_short'>short</span>
936
+ <span class='kw'>end</span></pre>
937
+ </td>
938
+ </tr>
939
+ </table>
940
+ </div>
941
+
942
+ <div class="method_details ">
943
+ <h3 class="signature " id="source_location-instance_method">
944
+
945
+ #<strong>source_location</strong> &#x21d2; <tt>Object</tt>
946
+
947
+
948
+
949
+
950
+
951
+ </h3><table class="source_code">
952
+ <tr>
953
+ <td>
954
+ <pre class="lines">
955
+
956
+
957
+ 70
958
+ 71
959
+ 72</pre>
960
+ </td>
961
+ <td>
962
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 70</span>
963
+
964
+ <span class='kw'>def</span> <span class='id identifier rubyid_source_location'>source_location</span>
965
+ <span class='ivar'>@service</span><span class='period'>.</span><span class='id identifier rubyid_instance_method'>instance_method</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_source_location'>source_location</span>
966
+ <span class='kw'>end</span></pre>
967
+ </td>
968
+ </tr>
969
+ </table>
970
+ </div>
971
+
972
+ <div class="method_details ">
973
+ <h3 class="signature " id="to_s-instance_method">
974
+
975
+ #<strong>to_s</strong> &#x21d2; <tt>Object</tt>
976
+
977
+
978
+
979
+
980
+
981
+ </h3><table class="source_code">
982
+ <tr>
983
+ <td>
984
+ <pre class="lines">
985
+
986
+
987
+ 35
988
+ 36
989
+ 37</pre>
990
+ </td>
991
+ <td>
992
+ <pre class="code"><span class="info file"># File 'lib/simple/service/action.rb', line 35</span>
993
+
994
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span> <span class='comment'># @private
995
+ </span> <span class='id identifier rubyid_full_name'>full_name</span>
996
+ <span class='kw'>end</span></pre>
997
+ </td>
998
+ </tr>
999
+ </table>
1000
+ </div>
1001
+
1002
+ </div>
1003
+
1004
+ </div>
1005
+
1006
+ <div id="footer">
1007
+ Generated on Tue Dec 3 13:46:26 2019 by
1008
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1009
+ 0.9.20 (ruby-2.5.1).
1010
+ </div>
1011
+
1012
+ </div>
1013
+ </body>
1014
+ </html>