action_command 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,625 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: ActionCommand::Executable
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!ActionCommand/Executable.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (E)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../ActionCommand.html" title="ActionCommand (module)">ActionCommand</a></span></span>
36
+ &raquo;
37
+ <span class="title">Executable</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: ActionCommand::Executable
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">ActionCommand::Executable</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/action_command.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Root class for action commands that can be executed by this library.
106
+ Override execute_internal to implement one, call one of the variants of
107
+ ActionCommand.execute_… to execute one.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
120
+ <ul class="summary">
121
+
122
+ <li class="public ">
123
+ <span class="summary_signature">
124
+
125
+ <a href="#parent-instance_method" title="#parent (instance method)">- (Object) <strong>parent</strong> </a>
126
+
127
+
128
+
129
+ </span>
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+ <span class="summary_desc"><div class='inline'>
143
+ <p>Returns the value of attribute parent.</p>
144
+ </div></span>
145
+
146
+ </li>
147
+
148
+
149
+ <li class="public ">
150
+ <span class="summary_signature">
151
+
152
+ <a href="#test-instance_method" title="#test (instance method)">- (Object) <strong>test</strong> </a>
153
+
154
+
155
+
156
+ </span>
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+ <span class="summary_desc"><div class='inline'>
170
+ <p>Returns the value of attribute test.</p>
171
+ </div></span>
172
+
173
+ </li>
174
+
175
+
176
+ </ul>
177
+
178
+
179
+
180
+
181
+
182
+ <h2>
183
+ Instance Method Summary
184
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
185
+ </h2>
186
+
187
+ <ul class="summary">
188
+
189
+ <li class="public ">
190
+ <span class="summary_signature">
191
+
192
+ <a href="#execute-instance_method" title="#execute (instance method)">- (ActionCommand::Result) <strong>execute</strong>(result) </a>
193
+
194
+
195
+
196
+ </span>
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ <span class="summary_desc"><div class='inline'>
207
+ <p>Execute the logic of a command.</p>
208
+ </div></span>
209
+
210
+ </li>
211
+
212
+
213
+ <li class="public ">
214
+ <span class="summary_signature">
215
+
216
+ <a href="#execute_internal-instance_method" title="#execute_internal (instance method)">- (Object) <strong>execute_internal</strong>(result) </a>
217
+
218
+
219
+
220
+ </span>
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+ <span class="summary_desc"><div class='inline'>
231
+ <p>Override this method to implement the logic of your command.</p>
232
+ </div></span>
233
+
234
+ </li>
235
+
236
+
237
+ <li class="public ">
238
+ <span class="summary_signature">
239
+
240
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Executable) <strong>initialize</strong>(args) </a>
241
+
242
+
243
+
244
+ </span>
245
+
246
+
247
+ <span class="note title constructor">constructor</span>
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+ <span class="summary_desc"><div class='inline'>
257
+ <p>Do not call new directly, instead use ActionCommand#execute_…</p>
258
+ </div></span>
259
+
260
+ </li>
261
+
262
+
263
+ <li class="public ">
264
+ <span class="summary_signature">
265
+
266
+ <a href="#testing-instance_method" title="#testing (instance method)">- (Object) <strong>testing</strong> {|context| ... }</a>
267
+
268
+
269
+
270
+ </span>
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+ <span class="summary_desc"><div class='inline'>
281
+ <p>Call this within a commands execution if you&#39;d like to perform
282
+ validations within the testing context.</p>
283
+ </div></span>
284
+
285
+ </li>
286
+
287
+
288
+ </ul>
289
+
290
+
291
+ <div id="constructor_details" class="method_details_list">
292
+ <h2>Constructor Details</h2>
293
+
294
+ <div class="method_details first">
295
+ <h3 class="signature first" id="initialize-instance_method">
296
+
297
+ - (<tt><span class='object_link'><a href="" title="ActionCommand::Executable (class)">Executable</a></span></tt>) <strong>initialize</strong>(args)
298
+
299
+
300
+
301
+
302
+
303
+ </h3><div class="docstring">
304
+ <div class="discussion">
305
+
306
+ <p>Do not call new directly, instead use ActionCommand#execute_… variants.</p>
307
+
308
+
309
+ </div>
310
+ </div>
311
+ <div class="tags">
312
+
313
+
314
+ </div><table class="source_code">
315
+ <tr>
316
+ <td>
317
+ <pre class="lines">
318
+
319
+
320
+ 243
321
+ 244
322
+ 245</pre>
323
+ </td>
324
+ <td>
325
+ <pre class="code"><span class="info file"># File 'lib/action_command.rb', line 243</span>
326
+
327
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
328
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_describe_io'>describe_io</span><span class='period'>.</span><span class='id identifier rubyid_assign_args'>assign_args</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
329
+ <span class='kw'>end</span></pre>
330
+ </td>
331
+ </tr>
332
+ </table>
333
+ </div>
334
+
335
+ </div>
336
+
337
+ <div id="instance_attr_details" class="attr_details">
338
+ <h2>Instance Attribute Details</h2>
339
+
340
+
341
+ <span id="parent=-instance_method"></span>
342
+ <div class="method_details first">
343
+ <h3 class="signature first" id="parent-instance_method">
344
+
345
+ - (<tt>Object</tt>) <strong>parent</strong>
346
+
347
+
348
+
349
+
350
+
351
+ </h3><div class="docstring">
352
+ <div class="discussion">
353
+
354
+ <p>Returns the value of attribute parent</p>
355
+
356
+
357
+ </div>
358
+ </div>
359
+ <div class="tags">
360
+
361
+
362
+ </div><table class="source_code">
363
+ <tr>
364
+ <td>
365
+ <pre class="lines">
366
+
367
+
368
+ 240
369
+ 241
370
+ 242</pre>
371
+ </td>
372
+ <td>
373
+ <pre class="code"><span class="info file"># File 'lib/action_command.rb', line 240</span>
374
+
375
+ <span class='kw'>def</span> <span class='id identifier rubyid_parent'>parent</span>
376
+ <span class='ivar'>@parent</span>
377
+ <span class='kw'>end</span></pre>
378
+ </td>
379
+ </tr>
380
+ </table>
381
+ </div>
382
+
383
+
384
+ <span id="test=-instance_method"></span>
385
+ <div class="method_details ">
386
+ <h3 class="signature " id="test-instance_method">
387
+
388
+ - (<tt>Object</tt>) <strong>test</strong>
389
+
390
+
391
+
392
+
393
+
394
+ </h3><div class="docstring">
395
+ <div class="discussion">
396
+
397
+ <p>Returns the value of attribute test</p>
398
+
399
+
400
+ </div>
401
+ </div>
402
+ <div class="tags">
403
+
404
+
405
+ </div><table class="source_code">
406
+ <tr>
407
+ <td>
408
+ <pre class="lines">
409
+
410
+
411
+ 240
412
+ 241
413
+ 242</pre>
414
+ </td>
415
+ <td>
416
+ <pre class="code"><span class="info file"># File 'lib/action_command.rb', line 240</span>
417
+
418
+ <span class='kw'>def</span> <span class='id identifier rubyid_test'>test</span>
419
+ <span class='ivar'>@test</span>
420
+ <span class='kw'>end</span></pre>
421
+ </td>
422
+ </tr>
423
+ </table>
424
+ </div>
425
+
426
+ </div>
427
+
428
+
429
+ <div id="instance_method_details" class="method_details_list">
430
+ <h2>Instance Method Details</h2>
431
+
432
+
433
+ <div class="method_details first">
434
+ <h3 class="signature first" id="execute-instance_method">
435
+
436
+ - (<tt><span class='object_link'><a href="Result.html" title="ActionCommand::Result (class)">ActionCommand::Result</a></span></tt>) <strong>execute</strong>(result)
437
+
438
+
439
+
440
+
441
+
442
+ </h3><div class="docstring">
443
+ <div class="discussion">
444
+
445
+ <p>Execute the logic of a command. Should not usually be called directly.
446
+ Command executors should call one of the ActionCommand.execute_… variants.
447
+ Command implementors should override execute_internal.</p>
448
+
449
+
450
+ </div>
451
+ </div>
452
+ <div class="tags">
453
+
454
+ <p class="tag_title">Returns:</p>
455
+ <ul class="return">
456
+
457
+ <li>
458
+
459
+
460
+ <span class='type'>(<tt><span class='object_link'><a href="Result.html" title="ActionCommand::Result (class)">ActionCommand::Result</a></span></tt>)</span>
461
+
462
+
463
+
464
+ </li>
465
+
466
+ </ul>
467
+
468
+ </div><table class="source_code">
469
+ <tr>
470
+ <td>
471
+ <pre class="lines">
472
+
473
+
474
+ 252
475
+ 253
476
+ 254
477
+ 255</pre>
478
+ </td>
479
+ <td>
480
+ <pre class="code"><span class="info file"># File 'lib/action_command.rb', line 252</span>
481
+
482
+ <span class='kw'>def</span> <span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
483
+ <span class='id identifier rubyid_execute_internal'>execute_internal</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
484
+ <span class='kw'>return</span> <span class='id identifier rubyid_result'>result</span>
485
+ <span class='kw'>end</span></pre>
486
+ </td>
487
+ </tr>
488
+ </table>
489
+ </div>
490
+
491
+ <div class="method_details ">
492
+ <h3 class="signature " id="execute_internal-instance_method">
493
+
494
+ - (<tt>Object</tt>) <strong>execute_internal</strong>(result)
495
+
496
+
497
+
498
+
499
+
500
+ </h3><div class="docstring">
501
+ <div class="discussion">
502
+
503
+ <p>Override this method to implement the logic of your command</p>
504
+
505
+
506
+ </div>
507
+ </div>
508
+ <div class="tags">
509
+ <p class="tag_title">Parameters:</p>
510
+ <ul class="param">
511
+
512
+ <li>
513
+
514
+ <span class='name'>result</span>
515
+
516
+
517
+ <span class='type'>(<tt><span class='object_link'><a href="Result.html" title="ActionCommand::Result (class)">ActionCommand::Result</a></span></tt>)</span>
518
+
519
+
520
+
521
+ &mdash;
522
+ <div class='inline'>
523
+ <p>a result object where you can store the results of your logic, or indicate
524
+ that the command failed.</p>
525
+ </div>
526
+
527
+ </li>
528
+
529
+ </ul>
530
+
531
+
532
+ </div><table class="source_code">
533
+ <tr>
534
+ <td>
535
+ <pre class="lines">
536
+
537
+
538
+ 271
539
+ 272
540
+ 273</pre>
541
+ </td>
542
+ <td>
543
+ <pre class="code"><span class="info file"># File 'lib/action_command.rb', line 271</span>
544
+
545
+ <span class='kw'>def</span> <span class='id identifier rubyid_execute_internal'>execute_internal</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
546
+
547
+ <span class='kw'>end</span></pre>
548
+ </td>
549
+ </tr>
550
+ </table>
551
+ </div>
552
+
553
+ <div class="method_details ">
554
+ <h3 class="signature " id="testing-instance_method">
555
+
556
+ - (<tt>Object</tt>) <strong>testing</strong> {|context| ... }
557
+
558
+
559
+
560
+
561
+
562
+ </h3><div class="docstring">
563
+ <div class="discussion">
564
+
565
+ <p>Call this within a commands execution if you&#39;d like to perform
566
+ validations within the testing context.</p>
567
+
568
+
569
+ </div>
570
+ </div>
571
+ <div class="tags">
572
+
573
+ <p class="tag_title">Yields:</p>
574
+ <ul class="yield">
575
+
576
+ <li>
577
+
578
+
579
+ <span class='type'>(<tt>context</tt>)</span>
580
+
581
+
582
+
583
+ &mdash;
584
+ <div class='inline'>
585
+ <p>Yields back the testing context that you passed in to
586
+ ActionCommand#execute_test.</p>
587
+ </div>
588
+
589
+ </li>
590
+
591
+ </ul>
592
+
593
+ </div><table class="source_code">
594
+ <tr>
595
+ <td>
596
+ <pre class="lines">
597
+
598
+
599
+ 261
600
+ 262
601
+ 263</pre>
602
+ </td>
603
+ <td>
604
+ <pre class="code"><span class="info file"># File 'lib/action_command.rb', line 261</span>
605
+
606
+ <span class='kw'>def</span> <span class='id identifier rubyid_testing'>testing</span>
607
+ <span class='kw'>yield</span> <span class='ivar'>@test</span> <span class='kw'>if</span> <span class='ivar'>@test</span>
608
+ <span class='kw'>end</span></pre>
609
+ </td>
610
+ </tr>
611
+ </table>
612
+ </div>
613
+
614
+ </div>
615
+
616
+ </div>
617
+
618
+ <div id="footer">
619
+ Generated on Sat Feb 13 10:16:47 2016 by
620
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
621
+ 0.8.7.6 (ruby-2.2.3).
622
+ </div>
623
+
624
+ </body>
625
+ </html>