csv_decision 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/CHANGELOG.md +4 -0
  4. data/README.md +62 -28
  5. data/csv_decision.gemspec +1 -1
  6. data/doc/CSVDecision/CellValidationError.html +2 -2
  7. data/doc/CSVDecision/Columns/Dictionary.html +114 -20
  8. data/doc/CSVDecision/Columns/Entry.html +2 -2
  9. data/doc/CSVDecision/Columns.html +109 -27
  10. data/doc/CSVDecision/Data.html +2 -2
  11. data/doc/CSVDecision/Decide.html +2 -2
  12. data/doc/CSVDecision/Decision.html +21 -21
  13. data/doc/CSVDecision/Dictionary/Entry.html +508 -0
  14. data/doc/CSVDecision/Dictionary.html +265 -0
  15. data/doc/CSVDecision/Error.html +2 -2
  16. data/doc/CSVDecision/FileError.html +3 -3
  17. data/doc/CSVDecision/Header.html +37 -136
  18. data/doc/CSVDecision/Input.html +2 -2
  19. data/doc/CSVDecision/Load.html +2 -2
  20. data/doc/CSVDecision/Matchers/Constant.html +2 -2
  21. data/doc/CSVDecision/Matchers/Function.html +2 -2
  22. data/doc/CSVDecision/Matchers/Guard.html +92 -25
  23. data/doc/CSVDecision/Matchers/Matcher.html +14 -18
  24. data/doc/CSVDecision/Matchers/Numeric.html +2 -2
  25. data/doc/CSVDecision/Matchers/Pattern.html +2 -2
  26. data/doc/CSVDecision/Matchers/Range.html +2 -2
  27. data/doc/CSVDecision/Matchers/Symbol.html +2 -2
  28. data/doc/CSVDecision/Matchers.html +5 -5
  29. data/doc/CSVDecision/Options.html +2 -2
  30. data/doc/CSVDecision/Parse.html +6 -4
  31. data/doc/CSVDecision/Result.html +944 -0
  32. data/doc/CSVDecision/ScanRow.html +70 -80
  33. data/doc/CSVDecision/Table.html +134 -54
  34. data/doc/CSVDecision.html +5 -5
  35. data/doc/_index.html +18 -4
  36. data/doc/class_list.html +1 -1
  37. data/doc/file.README.html +132 -62
  38. data/doc/index.html +132 -62
  39. data/doc/method_list.html +156 -60
  40. data/doc/top-level-namespace.html +2 -2
  41. data/lib/csv_decision/columns.rb +1 -8
  42. data/lib/csv_decision/decision.rb +45 -96
  43. data/lib/csv_decision/dictionary.rb +149 -0
  44. data/lib/csv_decision/header.rb +6 -133
  45. data/lib/csv_decision/matchers.rb +1 -2
  46. data/lib/csv_decision/parse.rb +18 -7
  47. data/lib/csv_decision/result.rb +180 -0
  48. data/lib/csv_decision/scan_row.rb +13 -7
  49. data/lib/csv_decision/table.rb +6 -5
  50. data/lib/csv_decision.rb +3 -1
  51. data/spec/csv_decision/columns_spec.rb +25 -4
  52. data/spec/csv_decision/examples_spec.rb +25 -0
  53. data/spec/csv_decision/matchers/guard_spec.rb +26 -9
  54. data/spec/csv_decision/table_spec.rb +48 -2
  55. metadata +7 -2
@@ -0,0 +1,944 @@
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: CSVDecision::Result
8
+
9
+ &mdash; Documentation by YARD 0.9.12
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 = "CSVDecision::Result";
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 (R)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span>
41
+ &raquo;
42
+ <span class="title">Result</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: CSVDecision::Result
63
+
64
+
65
+ <span class="private note title">Private</span>
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">CSVDecision::Result</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/csv_decision/result.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+ <p class="note private">
105
+ <strong>This class is part of a private API.</strong>
106
+ You should avoid using this class if possible, as it may be removed or be changed in the future.
107
+ </p>
108
+
109
+ <p>Accumulate the matching row(s) into a result hash.</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div>
118
+
119
+
120
+
121
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#attributes-instance_method" title="#attributes (instance method)">#<strong>attributes</strong> &#x21d2; Hash{Symbol=&gt;Object}, Hash{Integer=&gt;Object} </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+ <span class="note title readonly">readonly</span>
137
+
138
+
139
+
140
+
141
+
142
+
143
+ <span class="private note title">private</span>
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'>
147
+ <p>The decision result hash containing both result values and if: columns,
148
+ which eventually get evaluated and removed.</p>
149
+ </div></span>
150
+
151
+ </li>
152
+
153
+
154
+ <li class="public ">
155
+ <span class="summary_signature">
156
+
157
+ <a href="#multi_result-instance_method" title="#multi_result (instance method)">#<strong>multi_result</strong> &#x21d2; Boolean </a>
158
+
159
+
160
+
161
+ </span>
162
+
163
+
164
+
165
+
166
+ <span class="note title readonly">readonly</span>
167
+
168
+
169
+
170
+
171
+
172
+
173
+ <span class="private note title">private</span>
174
+
175
+
176
+ <span class="summary_desc"><div class='inline'>
177
+ <p>Returns true if this is a multi-row result.</p>
178
+ </div></span>
179
+
180
+ </li>
181
+
182
+
183
+ </ul>
184
+
185
+
186
+
187
+
188
+
189
+ <h2>
190
+ Instance Method Summary
191
+ <small><a href="#" class="summary_toggle">collapse</a></small>
192
+ </h2>
193
+
194
+ <ul class="summary">
195
+
196
+ <li class="public ">
197
+ <span class="summary_signature">
198
+
199
+ <a href="#accumulate_outs-instance_method" title="#accumulate_outs (instance method)">#<strong>accumulate_outs</strong>(row) &#x21d2; void </a>
200
+
201
+
202
+
203
+ </span>
204
+
205
+
206
+
207
+
208
+
209
+
210
+ <span class="private note title">private</span>
211
+
212
+
213
+ <span class="summary_desc"><div class='inline'>
214
+ <p>Accumulate the outs into arrays.</p>
215
+ </div></span>
216
+
217
+ </li>
218
+
219
+
220
+ <li class="public ">
221
+ <span class="summary_signature">
222
+
223
+ <a href="#add_outs-instance_method" title="#add_outs (instance method)">#<strong>add_outs</strong>(row) &#x21d2; void </a>
224
+
225
+
226
+
227
+ </span>
228
+
229
+
230
+
231
+
232
+
233
+
234
+ <span class="private note title">private</span>
235
+
236
+
237
+ <span class="summary_desc"><div class='inline'>
238
+ <p>Common case for building a single row result is just copying output column
239
+ values to the final result hash.</p>
240
+ </div></span>
241
+
242
+ </li>
243
+
244
+
245
+ <li class="public ">
246
+ <span class="summary_signature">
247
+
248
+ <a href="#eval_cell_proc-instance_method" title="#eval_cell_proc (instance method)">#<strong>eval_cell_proc</strong>(proc:, column_name:, index:) &#x21d2; Object </a>
249
+
250
+
251
+
252
+ </span>
253
+
254
+
255
+
256
+
257
+
258
+
259
+ <span class="private note title">private</span>
260
+
261
+
262
+ <span class="summary_desc"><div class='inline'>
263
+ <p>Evaluate the cell proc using the partial result calculated so far.</p>
264
+ </div></span>
265
+
266
+ </li>
267
+
268
+
269
+ <li class="public ">
270
+ <span class="summary_signature">
271
+
272
+ <a href="#eval_outs-instance_method" title="#eval_outs (instance method)">#<strong>eval_outs</strong>(row) &#x21d2; {Symbol=&gt;Object} </a>
273
+
274
+
275
+
276
+ </span>
277
+
278
+
279
+
280
+
281
+
282
+
283
+ <span class="private note title">private</span>
284
+
285
+
286
+ <span class="summary_desc"><div class='inline'>
287
+ <p>Evaluate the output columns, and use them to start building the final
288
+ result, along with the partial result required to evaluate functions.</p>
289
+ </div></span>
290
+
291
+ </li>
292
+
293
+
294
+ <li class="public ">
295
+ <span class="summary_signature">
296
+
297
+ <a href="#final-instance_method" title="#final (instance method)">#<strong>final</strong> &#x21d2; {Symbol=&gt;Object} </a>
298
+
299
+
300
+
301
+ </span>
302
+
303
+
304
+
305
+
306
+
307
+
308
+ <span class="private note title">private</span>
309
+
310
+
311
+ <span class="summary_desc"><div class='inline'>
312
+ <p>Derive the final result.</p>
313
+ </div></span>
314
+
315
+ </li>
316
+
317
+
318
+ <li class="public ">
319
+ <span class="summary_signature">
320
+
321
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(table:, input:) &#x21d2; Object </a>
322
+
323
+
324
+
325
+ </span>
326
+
327
+
328
+ <span class="note title constructor">constructor</span>
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+ <span class="summary_desc"><div class='inline'></div></span>
338
+
339
+ </li>
340
+
341
+
342
+ </ul>
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>(table:, input:) &#x21d2; <tt>Object</tt>
352
+
353
+
354
+
355
+
356
+
357
+ </h3><div class="docstring">
358
+ <div class="discussion">
359
+
360
+
361
+ </div>
362
+ </div>
363
+ <div class="tags">
364
+ <p class="tag_title">Parameters:</p>
365
+ <ul class="param">
366
+
367
+ <li>
368
+
369
+ <span class='name'>table</span>
370
+
371
+
372
+ <span class='type'>(<tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
373
+
374
+
375
+
376
+ &mdash;
377
+ <div class='inline'>
378
+ <p>Decision table being processed.</p>
379
+ </div>
380
+
381
+ </li>
382
+
383
+ <li>
384
+
385
+ <span class='name'>input</span>
386
+
387
+
388
+ <span class='type'>(<tt>Hash{Symbol=&gt;Object}</tt>)</span>
389
+
390
+
391
+
392
+ &mdash;
393
+ <div class='inline'>
394
+ <p>Input hash data structure.</p>
395
+ </div>
396
+
397
+ </li>
398
+
399
+ </ul>
400
+
401
+
402
+ </div><table class="source_code">
403
+ <tr>
404
+ <td>
405
+ <pre class="lines">
406
+
407
+
408
+ 19
409
+ 20
410
+ 21
411
+ 22
412
+ 23
413
+ 24
414
+ 25
415
+ 26
416
+ 27
417
+ 28</pre>
418
+ </td>
419
+ <td>
420
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/result.rb', line 19</span>
421
+
422
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>table:</span><span class='comma'>,</span> <span class='label'>input:</span><span class='rparen'>)</span>
423
+ <span class='ivar'>@outs</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_outs'>outs</span>
424
+ <span class='ivar'>@if_columns</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_ifs'>ifs</span>
425
+
426
+ <span class='comment'># Partial result always includes the input hash for calculating output functions.
427
+ </span> <span class='ivar'>@partial_result</span> <span class='op'>=</span> <span class='id identifier rubyid_input'>input</span><span class='lbracket'>[</span><span class='symbol'>:hash</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span> <span class='kw'>if</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_outs_functions'>outs_functions</span>
428
+
429
+ <span class='ivar'>@attributes</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
430
+ <span class='ivar'>@multi_result</span> <span class='op'>=</span> <span class='kw'>false</span>
431
+ <span class='kw'>end</span></pre>
432
+ </td>
433
+ </tr>
434
+ </table>
435
+ </div>
436
+
437
+ </div>
438
+
439
+ <div id="instance_attr_details" class="attr_details">
440
+ <h2>Instance Attribute Details</h2>
441
+
442
+
443
+ <span id=""></span>
444
+ <div class="method_details first">
445
+ <h3 class="signature first" id="attributes-instance_method">
446
+
447
+ #<strong>attributes</strong> &#x21d2; <tt>Hash{Symbol=&gt;Object}</tt>, <tt>Hash{Integer=&gt;Object}</tt> <span class="extras">(readonly)</span>
448
+
449
+
450
+
451
+
452
+
453
+ </h3><div class="docstring">
454
+ <div class="discussion">
455
+ <p class="note private">
456
+ <strong>This method is part of a private API.</strong>
457
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
458
+ </p>
459
+
460
+ <p>Returns The decision result hash containing both result values and if:
461
+ columns, which eventually get evaluated and removed.</p>
462
+
463
+
464
+ </div>
465
+ </div>
466
+ <div class="tags">
467
+
468
+ <p class="tag_title">Returns:</p>
469
+ <ul class="return">
470
+
471
+ <li>
472
+
473
+
474
+ <span class='type'>(<tt>Hash{Symbol=&gt;Object}</tt>, <tt>Hash{Integer=&gt;Object}</tt>)</span>
475
+
476
+
477
+
478
+ &mdash;
479
+ <div class='inline'>
480
+ <p>The decision result hash containing both result values and if: columns,
481
+ which eventually get evaluated and removed.</p>
482
+ </div>
483
+
484
+ </li>
485
+
486
+ </ul>
487
+
488
+ </div><table class="source_code">
489
+ <tr>
490
+ <td>
491
+ <pre class="lines">
492
+
493
+
494
+ 13
495
+ 14
496
+ 15</pre>
497
+ </td>
498
+ <td>
499
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/result.rb', line 13</span>
500
+
501
+ <span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span>
502
+ <span class='ivar'>@attributes</span>
503
+ <span class='kw'>end</span></pre>
504
+ </td>
505
+ </tr>
506
+ </table>
507
+ </div>
508
+
509
+
510
+ <span id=""></span>
511
+ <div class="method_details ">
512
+ <h3 class="signature " id="multi_result-instance_method">
513
+
514
+ #<strong>multi_result</strong> &#x21d2; <tt>Boolean</tt> <span class="extras">(readonly)</span>
515
+
516
+
517
+
518
+
519
+
520
+ </h3><div class="docstring">
521
+ <div class="discussion">
522
+ <p class="note private">
523
+ <strong>This method is part of a private API.</strong>
524
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
525
+ </p>
526
+
527
+ <p>Returns true if this is a multi-row result</p>
528
+
529
+
530
+ </div>
531
+ </div>
532
+ <div class="tags">
533
+
534
+ <p class="tag_title">Returns:</p>
535
+ <ul class="return">
536
+
537
+ <li>
538
+
539
+
540
+ <span class='type'>(<tt>Boolean</tt>)</span>
541
+
542
+
543
+
544
+ &mdash;
545
+ <div class='inline'>
546
+ <p>Returns true if this is a multi-row result</p>
547
+ </div>
548
+
549
+ </li>
550
+
551
+ </ul>
552
+
553
+ </div><table class="source_code">
554
+ <tr>
555
+ <td>
556
+ <pre class="lines">
557
+
558
+
559
+ 16
560
+ 17
561
+ 18</pre>
562
+ </td>
563
+ <td>
564
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/result.rb', line 16</span>
565
+
566
+ <span class='kw'>def</span> <span class='id identifier rubyid_multi_result'>multi_result</span>
567
+ <span class='ivar'>@multi_result</span>
568
+ <span class='kw'>end</span></pre>
569
+ </td>
570
+ </tr>
571
+ </table>
572
+ </div>
573
+
574
+ </div>
575
+
576
+
577
+ <div id="instance_method_details" class="method_details_list">
578
+ <h2>Instance Method Details</h2>
579
+
580
+
581
+ <div class="method_details first">
582
+ <h3 class="signature first" id="accumulate_outs-instance_method">
583
+
584
+ #<strong>accumulate_outs</strong>(row) &#x21d2; <tt>void</tt>
585
+
586
+
587
+
588
+
589
+
590
+ </h3><div class="docstring">
591
+ <div class="discussion">
592
+ <p class="note private">
593
+ <strong>This method is part of a private API.</strong>
594
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
595
+ </p>
596
+ <p class="note returns_void">This method returns an undefined value.</p>
597
+ <p>Accumulate the outs into arrays.</p>
598
+
599
+
600
+ </div>
601
+ </div>
602
+ <div class="tags">
603
+ <p class="tag_title">Parameters:</p>
604
+ <ul class="param">
605
+
606
+ <li>
607
+
608
+ <span class='name'>row</span>
609
+
610
+
611
+ <span class='type'>(<tt>Array</tt>)</span>
612
+
613
+
614
+
615
+ </li>
616
+
617
+ </ul>
618
+
619
+
620
+ </div><table class="source_code">
621
+ <tr>
622
+ <td>
623
+ <pre class="lines">
624
+
625
+
626
+ 41
627
+ 42
628
+ 43</pre>
629
+ </td>
630
+ <td>
631
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/result.rb', line 41</span>
632
+
633
+ <span class='kw'>def</span> <span class='id identifier rubyid_accumulate_outs'>accumulate_outs</span><span class='lparen'>(</span><span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
634
+ <span class='ivar'>@outs</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_col'>col</span><span class='comma'>,</span> <span class='id identifier rubyid_column'>column</span><span class='op'>|</span> <span class='id identifier rubyid_add_cell'>add_cell</span><span class='lparen'>(</span><span class='label'>column_name:</span> <span class='id identifier rubyid_column'>column</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>cell:</span> <span class='id identifier rubyid_row'>row</span><span class='lbracket'>[</span><span class='id identifier rubyid_col'>col</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
635
+ <span class='kw'>end</span></pre>
636
+ </td>
637
+ </tr>
638
+ </table>
639
+ </div>
640
+
641
+ <div class="method_details ">
642
+ <h3 class="signature " id="add_outs-instance_method">
643
+
644
+ #<strong>add_outs</strong>(row) &#x21d2; <tt>void</tt>
645
+
646
+
647
+
648
+
649
+
650
+ </h3><div class="docstring">
651
+ <div class="discussion">
652
+ <p class="note private">
653
+ <strong>This method is part of a private API.</strong>
654
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
655
+ </p>
656
+ <p class="note returns_void">This method returns an undefined value.</p>
657
+ <p>Common case for building a single row result is just copying output column
658
+ values to the final result hash.</p>
659
+
660
+
661
+ </div>
662
+ </div>
663
+ <div class="tags">
664
+ <p class="tag_title">Parameters:</p>
665
+ <ul class="param">
666
+
667
+ <li>
668
+
669
+ <span class='name'>row</span>
670
+
671
+
672
+ <span class='type'>(<tt>Array</tt>)</span>
673
+
674
+
675
+
676
+ </li>
677
+
678
+ </ul>
679
+
680
+
681
+ </div><table class="source_code">
682
+ <tr>
683
+ <td>
684
+ <pre class="lines">
685
+
686
+
687
+ 34
688
+ 35
689
+ 36</pre>
690
+ </td>
691
+ <td>
692
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/result.rb', line 34</span>
693
+
694
+ <span class='kw'>def</span> <span class='id identifier rubyid_add_outs'>add_outs</span><span class='lparen'>(</span><span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
695
+ <span class='ivar'>@outs</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_col'>col</span><span class='comma'>,</span> <span class='id identifier rubyid_column'>column</span><span class='op'>|</span> <span class='ivar'>@attributes</span><span class='lbracket'>[</span><span class='id identifier rubyid_column'>column</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_row'>row</span><span class='lbracket'>[</span><span class='id identifier rubyid_col'>col</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
696
+ <span class='kw'>end</span></pre>
697
+ </td>
698
+ </tr>
699
+ </table>
700
+ </div>
701
+
702
+ <div class="method_details ">
703
+ <h3 class="signature " id="eval_cell_proc-instance_method">
704
+
705
+ #<strong>eval_cell_proc</strong>(proc:, column_name:, index:) &#x21d2; <tt>Object</tt>
706
+
707
+
708
+
709
+
710
+
711
+ </h3><div class="docstring">
712
+ <div class="discussion">
713
+ <p class="note private">
714
+ <strong>This method is part of a private API.</strong>
715
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
716
+ </p>
717
+
718
+ <p>Evaluate the cell proc using the partial result calculated so far.</p>
719
+
720
+
721
+ </div>
722
+ </div>
723
+ <div class="tags">
724
+ <p class="tag_title">Parameters:</p>
725
+ <ul class="param">
726
+
727
+ <li>
728
+
729
+ <span class='name'>proc</span>
730
+
731
+
732
+ <span class='type'>(<tt>Matchers::Pro</tt>)</span>
733
+
734
+
735
+
736
+ </li>
737
+
738
+ <li>
739
+
740
+ <span class='name'>column_name</span>
741
+
742
+
743
+ <span class='type'>(<tt>Symbol</tt>, <tt>Integer</tt>)</span>
744
+
745
+
746
+
747
+ </li>
748
+
749
+ <li>
750
+
751
+ <span class='name'>index</span>
752
+
753
+
754
+ <span class='type'>(<tt>Integer</tt>)</span>
755
+
756
+
757
+
758
+ </li>
759
+
760
+ </ul>
761
+
762
+
763
+ </div><table class="source_code">
764
+ <tr>
765
+ <td>
766
+ <pre class="lines">
767
+
768
+
769
+ 73
770
+ 74
771
+ 75</pre>
772
+ </td>
773
+ <td>
774
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/result.rb', line 73</span>
775
+
776
+ <span class='kw'>def</span> <span class='id identifier rubyid_eval_cell_proc'>eval_cell_proc</span><span class='lparen'>(</span><span class='label'>proc:</span><span class='comma'>,</span> <span class='label'>column_name:</span><span class='comma'>,</span> <span class='label'>index:</span><span class='rparen'>)</span>
777
+ <span class='ivar'>@attributes</span><span class='lbracket'>[</span><span class='id identifier rubyid_column_name'>column_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_proc'>proc</span><span class='period'>.</span><span class='id identifier rubyid_function'>function</span><span class='lbracket'>[</span><span class='id identifier rubyid_partial_result'>partial_result</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span><span class='rbracket'>]</span>
778
+ <span class='kw'>end</span></pre>
779
+ </td>
780
+ </tr>
781
+ </table>
782
+ </div>
783
+
784
+ <div class="method_details ">
785
+ <h3 class="signature " id="eval_outs-instance_method">
786
+
787
+ #<strong>eval_outs</strong>(row) &#x21d2; <tt>{Symbol=&gt;Object}</tt>
788
+
789
+
790
+
791
+
792
+
793
+ </h3><div class="docstring">
794
+ <div class="discussion">
795
+ <p class="note private">
796
+ <strong>This method is part of a private API.</strong>
797
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
798
+ </p>
799
+
800
+ <p>Evaluate the output columns, and use them to start building the final
801
+ result, along with the partial result required to evaluate functions.</p>
802
+
803
+
804
+ </div>
805
+ </div>
806
+ <div class="tags">
807
+ <p class="tag_title">Parameters:</p>
808
+ <ul class="param">
809
+
810
+ <li>
811
+
812
+ <span class='name'>row</span>
813
+
814
+
815
+ <span class='type'>(<tt>Array</tt>)</span>
816
+
817
+
818
+
819
+ </li>
820
+
821
+ </ul>
822
+
823
+ <p class="tag_title">Returns:</p>
824
+ <ul class="return">
825
+
826
+ <li>
827
+
828
+
829
+ <span class='type'>(<tt>{Symbol=&gt;Object}</tt>)</span>
830
+
831
+
832
+
833
+ </li>
834
+
835
+ </ul>
836
+
837
+ </div><table class="source_code">
838
+ <tr>
839
+ <td>
840
+ <pre class="lines">
841
+
842
+
843
+ 58
844
+ 59
845
+ 60
846
+ 61
847
+ 62
848
+ 63
849
+ 64
850
+ 65
851
+ 66</pre>
852
+ </td>
853
+ <td>
854
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/result.rb', line 58</span>
855
+
856
+ <span class='kw'>def</span> <span class='id identifier rubyid_eval_outs'>eval_outs</span><span class='lparen'>(</span><span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
857
+ <span class='comment'># Set the constants first, in case the functions refer to them
858
+ </span> <span class='id identifier rubyid_eval_outs_constants'>eval_outs_constants</span><span class='lparen'>(</span><span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
859
+
860
+ <span class='comment'># Then evaluate the procs, left to right
861
+ </span> <span class='id identifier rubyid_eval_outs_procs'>eval_outs_procs</span><span class='lparen'>(</span><span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
862
+
863
+ <span class='id identifier rubyid_final'>final</span>
864
+ <span class='kw'>end</span></pre>
865
+ </td>
866
+ </tr>
867
+ </table>
868
+ </div>
869
+
870
+ <div class="method_details ">
871
+ <h3 class="signature " id="final-instance_method">
872
+
873
+ #<strong>final</strong> &#x21d2; <tt>{Symbol=&gt;Object}</tt>
874
+
875
+
876
+
877
+
878
+
879
+ </h3><div class="docstring">
880
+ <div class="discussion">
881
+ <p class="note private">
882
+ <strong>This method is part of a private API.</strong>
883
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
884
+ </p>
885
+
886
+ <p>Derive the final result.</p>
887
+
888
+
889
+ </div>
890
+ </div>
891
+ <div class="tags">
892
+
893
+ <p class="tag_title">Returns:</p>
894
+ <ul class="return">
895
+
896
+ <li>
897
+
898
+
899
+ <span class='type'>(<tt>{Symbol=&gt;Object}</tt>)</span>
900
+
901
+
902
+
903
+ </li>
904
+
905
+ </ul>
906
+
907
+ </div><table class="source_code">
908
+ <tr>
909
+ <td>
910
+ <pre class="lines">
911
+
912
+
913
+ 47
914
+ 48
915
+ 49
916
+ 50
917
+ 51</pre>
918
+ </td>
919
+ <td>
920
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/result.rb', line 47</span>
921
+
922
+ <span class='kw'>def</span> <span class='id identifier rubyid_final'>final</span>
923
+ <span class='kw'>return</span> <span class='ivar'>@attributes</span> <span class='kw'>if</span> <span class='ivar'>@if_columns</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
924
+
925
+ <span class='ivar'>@multi_result</span> <span class='op'>?</span> <span class='id identifier rubyid_multi_row_result'>multi_row_result</span> <span class='op'>:</span> <span class='id identifier rubyid_single_row_result'>single_row_result</span>
926
+ <span class='kw'>end</span></pre>
927
+ </td>
928
+ </tr>
929
+ </table>
930
+ </div>
931
+
932
+ </div>
933
+
934
+ </div>
935
+
936
+ <div id="footer">
937
+ Generated on Fri Jan 5 21:44:00 2018 by
938
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
939
+ 0.9.12 (ruby-2.4.0).
940
+ </div>
941
+
942
+ </div>
943
+ </body>
944
+ </html>