csv_decision 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/csv_decision.gemspec +1 -1
- data/doc/CSVDecision/CellValidationError.html +1 -1
- data/doc/CSVDecision/Columns/Dictionary.html +1 -1
- data/doc/CSVDecision/Columns.html +1 -1
- data/doc/CSVDecision/Data.html +1 -1
- data/doc/CSVDecision/Decision.html +51 -147
- data/doc/CSVDecision/Defaults.html +1 -1
- data/doc/CSVDecision/Dictionary/Entry.html +1 -1
- data/doc/CSVDecision/Dictionary.html +1 -1
- data/doc/CSVDecision/Error.html +1 -1
- data/doc/CSVDecision/FileError.html +1 -1
- data/doc/CSVDecision/Header.html +1 -1
- data/doc/CSVDecision/Index.html +1 -1
- data/doc/CSVDecision/Input.html +2 -2
- data/doc/CSVDecision/Load.html +16 -11
- data/doc/CSVDecision/Matchers/Constant.html +1 -1
- data/doc/CSVDecision/Matchers/Function.html +3 -3
- data/doc/CSVDecision/Matchers/Guard.html +1 -1
- data/doc/CSVDecision/Matchers/Matcher.html +1 -1
- data/doc/CSVDecision/Matchers/Numeric.html +1 -1
- data/doc/CSVDecision/Matchers/Pattern.html +1 -1
- data/doc/CSVDecision/Matchers/Proc.html +1 -1
- data/doc/CSVDecision/Matchers/Range.html +1 -1
- data/doc/CSVDecision/Matchers/Symbol.html +1 -1
- data/doc/CSVDecision/Matchers.html +3 -3
- data/doc/CSVDecision/Options.html +1 -1
- data/doc/CSVDecision/Parse.html +3 -3
- data/doc/CSVDecision/Result.html +9 -22
- data/doc/CSVDecision/ScanRow.html +4 -6
- data/doc/CSVDecision/Table.html +10 -2
- data/doc/CSVDecision/TableValidationError.html +1 -1
- data/doc/CSVDecision/Validate.html +1 -1
- data/doc/CSVDecision.html +18 -13
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +63 -63
- data/doc/top-level-namespace.html +1 -1
- data/lib/csv_decision/decision.rb +47 -45
- data/lib/csv_decision/load.rb +5 -4
- data/lib/csv_decision/parse.rb +1 -1
- data/lib/csv_decision/result.rb +3 -3
- data/lib/csv_decision/scan_row.rb +4 -5
- data/lib/csv_decision/table.rb +4 -0
- data/spec/csv_decision/table_spec.rb +1 -0
- data/spec/data/valid/index_example.csv +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb96b1d411143422f0f4c1f97387eedc8201dde3
|
4
|
+
data.tar.gz: d8e8f472aef2fd94cd27f5e0f88dc367059b1622
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a37235cdddef0ccc57f09a11b07fe90a913bc7f7c6d917ce25eb8ad4f50ab511814079e0085f9dc705685fa34345cfbac77ae916139ef3a9e3a295fa9b7a714
|
7
|
+
data.tar.gz: 46dd898df746be2efbef4a1d5a9372067ee3a43bfaebe54ad9a212b82b615a2c28d4ac0fb60a52c8428e6f81b9eb7073464daccb7d4a64c67754280c498203e6
|
data/CHANGELOG.md
CHANGED
data/csv_decision.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'csv_decision'
|
8
|
-
spec.version = '0.3.
|
8
|
+
spec.version = '0.3.2'
|
9
9
|
spec.authors = ['Brett Vickers']
|
10
10
|
spec.email = ['brett@phillips-vickers.com']
|
11
11
|
spec.description = 'CSV based Ruby decision tables.'
|
@@ -133,7 +133,7 @@
|
|
133
133
|
</div>
|
134
134
|
|
135
135
|
<div id="footer">
|
136
|
-
Generated on Sun Jan
|
136
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
137
137
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
138
138
|
0.9.12 (ruby-2.4.0).
|
139
139
|
</div>
|
@@ -697,7 +697,7 @@ of :outs.</p>
|
|
697
697
|
</div>
|
698
698
|
|
699
699
|
<div id="footer">
|
700
|
-
Generated on Sun Jan
|
700
|
+
Generated on Sun Jan 28 11:58:39 2018 by
|
701
701
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
702
702
|
0.9.12 (ruby-2.4.0).
|
703
703
|
</div>
|
@@ -1167,7 +1167,7 @@
|
|
1167
1167
|
</div>
|
1168
1168
|
|
1169
1169
|
<div id="footer">
|
1170
|
-
Generated on Sun Jan
|
1170
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
1171
1171
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1172
1172
|
0.9.12 (ruby-2.4.0).
|
1173
1173
|
</div>
|
data/doc/CSVDecision/Data.html
CHANGED
@@ -469,7 +469,7 @@ array of arrays. Strips out empty columns/rows and comment cells.</p>
|
|
469
469
|
</div>
|
470
470
|
|
471
471
|
<div id="footer">
|
472
|
-
Generated on Sun Jan
|
472
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
473
473
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
474
474
|
0.9.12 (ruby-2.4.0).
|
475
475
|
</div>
|
@@ -132,7 +132,7 @@
|
|
132
132
|
<li class="public ">
|
133
133
|
<span class="summary_signature">
|
134
134
|
|
135
|
-
<a href="#make-class_method" title="make (class method)">.<strong>make</strong>(table:, input:, symbolize_keys:) ⇒ Hash </a>
|
135
|
+
<a href="#make-class_method" title="make (class method)">.<strong>make</strong>(table:, input:, symbolize_keys:) ⇒ Hash{Symbol=>Object} </a>
|
136
136
|
|
137
137
|
|
138
138
|
|
@@ -165,7 +165,7 @@
|
|
165
165
|
<li class="public ">
|
166
166
|
<span class="summary_signature">
|
167
167
|
|
168
|
-
<a href="#
|
168
|
+
<a href="#index_scan-instance_method" title="#index_scan (instance method)">#<strong>index_scan</strong> ⇒ Hash{Symbol=>Object} </a>
|
169
169
|
|
170
170
|
|
171
171
|
|
@@ -215,7 +215,7 @@
|
|
215
215
|
<li class="public ">
|
216
216
|
<span class="summary_signature">
|
217
217
|
|
218
|
-
<a href="#
|
218
|
+
<a href="#table_scan-instance_method" title="#table_scan (instance method)">#<strong>table_scan</strong> ⇒ Hash{Symbol=>Object} </a>
|
219
219
|
|
220
220
|
|
221
221
|
|
@@ -308,6 +308,8 @@
|
|
308
308
|
<pre class="lines">
|
309
309
|
|
310
310
|
|
311
|
+
32
|
312
|
+
33
|
311
313
|
34
|
312
314
|
35
|
313
315
|
36
|
@@ -318,21 +320,25 @@
|
|
318
320
|
41
|
319
321
|
42
|
320
322
|
43
|
321
|
-
44
|
323
|
+
44
|
324
|
+
45</pre>
|
322
325
|
</td>
|
323
326
|
<td>
|
324
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/decision.rb', line
|
327
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/decision.rb', line 32</span>
|
325
328
|
|
326
329
|
<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>
|
327
330
|
<span class='comment'># The result object is a hash of values, and each value will be an array if this is
|
328
331
|
</span> <span class='comment'># a multi-row result for the +first_match: false+ option.
|
329
|
-
</span> <span class='ivar'>@result</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Result.html" title="CSVDecision::Result (class)">Result</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result.html#initialize-instance_method" title="CSVDecision::Result#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>table:</span> <span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='label'>input:</span> <span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
|
332
|
+
</span> <span class='ivar'>@result</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Result.html" title="CSVDecision::Result (class)">Result</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result.html#initialize-instance_method" title="CSVDecision::Result#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>table:</span> <span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='label'>input:</span> <span class='id identifier rubyid_input'>input</span><span class='lbracket'>[</span><span class='symbol'>:hash</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
330
333
|
|
331
334
|
<span class='comment'># All rows picked by the matching process. An array if +first_match: false+,
|
332
335
|
</span> <span class='comment'># otherwise a single row.
|
333
336
|
</span> <span class='ivar'>@rows_picked</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
334
337
|
|
335
338
|
<span class='ivar'>@first_match</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:first_match</span><span class='rbracket'>]</span>
|
339
|
+
|
340
|
+
<span class='ivar'>@table</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span>
|
341
|
+
<span class='ivar'>@input</span> <span class='op'>=</span> <span class='id identifier rubyid_input'>input</span>
|
336
342
|
<span class='kw'>end</span></pre>
|
337
343
|
</td>
|
338
344
|
</tr>
|
@@ -349,7 +355,7 @@
|
|
349
355
|
<div class="method_details first">
|
350
356
|
<h3 class="signature first" id="make-class_method">
|
351
357
|
|
352
|
-
.<strong>make</strong>(table:, input:, symbolize_keys:) ⇒ <tt>Hash</tt>
|
358
|
+
.<strong>make</strong>(table:, input:, symbolize_keys:) ⇒ <tt>Hash{Symbol=>Object}</tt>
|
353
359
|
|
354
360
|
|
355
361
|
|
@@ -408,7 +414,7 @@
|
|
408
414
|
<span class='name'>symbolize_keys</span>
|
409
415
|
|
410
416
|
|
411
|
-
<span class='type'>(<tt>
|
417
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
412
418
|
|
413
419
|
|
414
420
|
|
@@ -428,7 +434,7 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
428
434
|
<li>
|
429
435
|
|
430
436
|
|
431
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
437
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
432
438
|
|
433
439
|
|
434
440
|
|
@@ -457,9 +463,7 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
457
463
|
25
|
458
464
|
26
|
459
465
|
27
|
460
|
-
28
|
461
|
-
29
|
462
|
-
30</pre>
|
466
|
+
28</pre>
|
463
467
|
</td>
|
464
468
|
<td>
|
465
469
|
<pre class="code"><span class="info file"># File 'lib/csv_decision/decision.rb', line 18</span>
|
@@ -470,12 +474,10 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
470
474
|
|
471
475
|
<span class='comment'># The decision object collects the results of the search and
|
472
476
|
</span> <span class='comment'># calculates the final result
|
473
|
-
</span> <span class='id identifier rubyid_decision'>decision</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="CSVDecision::Decision (class)">Decision</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="CSVDecision::Decision#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>table:</span> <span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='label'>input:</span> <span class='id identifier rubyid_input'>input</span><span class='
|
477
|
+
</span> <span class='id identifier rubyid_decision'>decision</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="CSVDecision::Decision (class)">Decision</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="CSVDecision::Decision#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>table:</span> <span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='label'>input:</span> <span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
|
474
478
|
|
475
479
|
<span class='comment'># Use the table's index if present
|
476
|
-
</span> <span class='
|
477
|
-
|
478
|
-
<span class='id identifier rubyid_decision'>decision</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='label'>table:</span> <span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='label'>hash:</span> <span class='id identifier rubyid_input'>input</span><span class='lbracket'>[</span><span class='symbol'>:hash</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>scan_cols:</span> <span class='id identifier rubyid_input'>input</span><span class='lbracket'>[</span><span class='symbol'>:scan_cols</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
480
|
+
</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='op'>?</span> <span class='id identifier rubyid_decision'>decision</span><span class='period'>.</span><span class='id identifier rubyid_index_scan'>index_scan</span> <span class='op'>:</span> <span class='id identifier rubyid_decision'>decision</span><span class='period'>.</span><span class='id identifier rubyid_table_scan'>table_scan</span>
|
479
481
|
<span class='kw'>end</span></pre>
|
480
482
|
</td>
|
481
483
|
</tr>
|
@@ -489,9 +491,9 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
489
491
|
|
490
492
|
|
491
493
|
<div class="method_details first">
|
492
|
-
<h3 class="signature first" id="
|
494
|
+
<h3 class="signature first" id="index_scan-instance_method">
|
493
495
|
|
494
|
-
#<strong>
|
496
|
+
#<strong>index_scan</strong> ⇒ <tt>Hash{Symbol=>Object}</tt>
|
495
497
|
|
496
498
|
|
497
499
|
|
@@ -510,66 +512,14 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
510
512
|
</div>
|
511
513
|
</div>
|
512
514
|
<div class="tags">
|
513
|
-
<p class="tag_title">Parameters:</p>
|
514
|
-
<ul class="param">
|
515
|
-
|
516
|
-
<li>
|
517
|
-
|
518
|
-
<span class='name'>input</span>
|
519
|
-
|
520
|
-
|
521
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
—
|
526
|
-
<div class='inline'>
|
527
|
-
<p>Hash of parsed input data.</p>
|
528
|
-
</div>
|
529
|
-
|
530
|
-
</li>
|
531
|
-
|
532
|
-
<li>
|
533
|
-
|
534
|
-
<span class='name'>table</span>
|
535
|
-
|
536
|
-
|
537
|
-
<span class='type'>(<tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
—
|
542
|
-
<div class='inline'>
|
543
|
-
<p>Decision table being processed.</p>
|
544
|
-
</div>
|
545
|
-
|
546
|
-
</li>
|
547
515
|
|
548
|
-
<li>
|
549
|
-
|
550
|
-
<span class='name'>input</span>
|
551
|
-
|
552
|
-
|
553
|
-
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
—
|
558
|
-
<div class='inline'>
|
559
|
-
<p>Input hash data structure.</p>
|
560
|
-
</div>
|
561
|
-
|
562
|
-
</li>
|
563
|
-
|
564
|
-
</ul>
|
565
|
-
|
566
516
|
<p class="tag_title">Returns:</p>
|
567
517
|
<ul class="return">
|
568
518
|
|
569
519
|
<li>
|
570
520
|
|
571
521
|
|
572
|
-
<span class='type'>(<tt>{Symbol=>Object}</tt>)</span>
|
522
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
573
523
|
|
574
524
|
|
575
525
|
|
@@ -588,8 +538,6 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
588
538
|
<pre class="lines">
|
589
539
|
|
590
540
|
|
591
|
-
62
|
592
|
-
63
|
593
541
|
64
|
594
542
|
65
|
595
543
|
66
|
@@ -602,26 +550,22 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
602
550
|
73
|
603
551
|
74
|
604
552
|
75
|
605
|
-
76
|
606
|
-
77</pre>
|
553
|
+
76</pre>
|
607
554
|
</td>
|
608
555
|
<td>
|
609
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/decision.rb', line
|
556
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/decision.rb', line 64</span>
|
610
557
|
|
611
|
-
<span class='kw'>def</span> <span class='id identifier
|
612
|
-
<span class='comment'># If the index lookup fails, there's no match
|
613
|
-
</span> <span class='kw'>return</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='id identifier rubyid_index_rows'>index_rows</span> <span class='op'>=</span> <span class='
|
558
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_index_scan'>index_scan</span>
|
559
|
+
<span class='comment'># If the index lookup fails, there's no match.
|
560
|
+
</span> <span class='kw'>return</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='id identifier rubyid_index_rows'>index_rows</span> <span class='op'>=</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='ivar'>@table</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='ivar'>@input</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
561
|
+
|
562
|
+
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='ivar'>@input</span><span class='lbracket'>[</span><span class='symbol'>:hash</span><span class='rbracket'>]</span>
|
563
|
+
<span class='id identifier rubyid_scan_cols'>scan_cols</span> <span class='op'>=</span> <span class='ivar'>@input</span><span class='lbracket'>[</span><span class='symbol'>:scan_cols</span><span class='rbracket'>]</span>
|
614
564
|
|
615
565
|
<span class='kw'>if</span> <span class='ivar'>@first_match</span>
|
616
|
-
<span class='id identifier rubyid_index_scan_first_match'>index_scan_first_match</span><span class='lparen'>(</span><span class='label'>
|
617
|
-
<span class='label'>scan_cols:</span> <span class='id identifier rubyid_input'>input</span><span class='lbracket'>[</span><span class='symbol'>:scan_cols</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
618
|
-
<span class='label'>hash:</span> <span class='id identifier rubyid_input'>input</span><span class='lbracket'>[</span><span class='symbol'>:hash</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
619
|
-
<span class='label'>index_rows:</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_index_rows'>index_rows</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
566
|
+
<span class='id identifier rubyid_index_scan_first_match'>index_scan_first_match</span><span class='lparen'>(</span><span class='label'>scan_cols:</span> <span class='id identifier rubyid_scan_cols'>scan_cols</span><span class='comma'>,</span> <span class='label'>hash:</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='label'>index_rows:</span> <span class='id identifier rubyid_index_rows'>index_rows</span><span class='rparen'>)</span>
|
620
567
|
<span class='kw'>else</span>
|
621
|
-
<span class='id identifier rubyid_index_scan_accumulate'>index_scan_accumulate</span><span class='lparen'>(</span><span class='label'>
|
622
|
-
<span class='label'>scan_cols:</span> <span class='id identifier rubyid_input'>input</span><span class='lbracket'>[</span><span class='symbol'>:scan_cols</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
623
|
-
<span class='label'>hash:</span> <span class='id identifier rubyid_input'>input</span><span class='lbracket'>[</span><span class='symbol'>:hash</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
624
|
-
<span class='label'>index_rows:</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_index_rows'>index_rows</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
568
|
+
<span class='id identifier rubyid_index_scan_accumulate'>index_scan_accumulate</span><span class='lparen'>(</span><span class='label'>scan_cols:</span> <span class='id identifier rubyid_scan_cols'>scan_cols</span><span class='comma'>,</span> <span class='label'>hash:</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='label'>index_rows:</span> <span class='id identifier rubyid_index_rows'>index_rows</span><span class='rparen'>)</span>
|
625
569
|
<span class='kw'>end</span>
|
626
570
|
<span class='kw'>end</span></pre>
|
627
571
|
</td>
|
@@ -630,9 +574,9 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
630
574
|
</div>
|
631
575
|
|
632
576
|
<div class="method_details ">
|
633
|
-
<h3 class="signature " id="
|
577
|
+
<h3 class="signature " id="table_scan-instance_method">
|
634
578
|
|
635
|
-
#<strong>
|
579
|
+
#<strong>table_scan</strong> ⇒ <tt>Hash{Symbol=>Object}</tt>
|
636
580
|
|
637
581
|
|
638
582
|
|
@@ -651,59 +595,7 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
651
595
|
</div>
|
652
596
|
</div>
|
653
597
|
<div class="tags">
|
654
|
-
<p class="tag_title">Parameters:</p>
|
655
|
-
<ul class="param">
|
656
|
-
|
657
|
-
<li>
|
658
|
-
|
659
|
-
<span class='name'>hash</span>
|
660
|
-
|
661
|
-
|
662
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
—
|
667
|
-
<div class='inline'>
|
668
|
-
<p>Input hash.</p>
|
669
|
-
</div>
|
670
|
-
|
671
|
-
</li>
|
672
|
-
|
673
|
-
<li>
|
674
|
-
|
675
|
-
<span class='name'>scan_cols</span>
|
676
|
-
|
677
|
-
|
678
|
-
<span class='type'>(<tt>Hash{<span class='object_link'><a href="Index.html" title="CSVDecision::Index (class)">Index</a></span>=>Object}</tt>)</span>
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
—
|
683
|
-
<div class='inline'>
|
684
|
-
<p>Input column values to scan.</p>
|
685
|
-
</div>
|
686
|
-
|
687
|
-
</li>
|
688
598
|
|
689
|
-
<li>
|
690
|
-
|
691
|
-
<span class='name'>table</span>
|
692
|
-
|
693
|
-
|
694
|
-
<span class='type'>(<tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
—
|
699
|
-
<div class='inline'>
|
700
|
-
<p>Decision table being processed.</p>
|
701
|
-
</div>
|
702
|
-
|
703
|
-
</li>
|
704
|
-
|
705
|
-
</ul>
|
706
|
-
|
707
599
|
<p class="tag_title">Returns:</p>
|
708
600
|
<ul class="return">
|
709
601
|
|
@@ -729,17 +621,29 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
729
621
|
<pre class="lines">
|
730
622
|
|
731
623
|
|
624
|
+
50
|
625
|
+
51
|
732
626
|
52
|
733
627
|
53
|
734
628
|
54
|
735
|
-
55
|
629
|
+
55
|
630
|
+
56
|
631
|
+
57
|
632
|
+
58
|
633
|
+
59</pre>
|
736
634
|
</td>
|
737
635
|
<td>
|
738
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/decision.rb', line
|
636
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/decision.rb', line 50</span>
|
637
|
+
|
638
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_table_scan'>table_scan</span>
|
639
|
+
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='ivar'>@input</span><span class='lbracket'>[</span><span class='symbol'>:hash</span><span class='rbracket'>]</span>
|
640
|
+
<span class='id identifier rubyid_scan_cols'>scan_cols</span> <span class='op'>=</span> <span class='ivar'>@input</span><span class='lbracket'>[</span><span class='symbol'>:scan_cols</span><span class='rbracket'>]</span>
|
739
641
|
|
740
|
-
<span class='kw'>
|
741
|
-
|
742
|
-
<span class='
|
642
|
+
<span class='kw'>if</span> <span class='ivar'>@first_match</span>
|
643
|
+
<span class='id identifier rubyid_scan_first_match'>scan_first_match</span><span class='lparen'>(</span><span class='label'>hash:</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='label'>scan_cols:</span> <span class='id identifier rubyid_scan_cols'>scan_cols</span><span class='rparen'>)</span>
|
644
|
+
<span class='kw'>else</span>
|
645
|
+
<span class='id identifier rubyid_scan_accumulate'>scan_accumulate</span><span class='lparen'>(</span><span class='label'>hash:</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='label'>scan_cols:</span> <span class='id identifier rubyid_scan_cols'>scan_cols</span><span class='rparen'>)</span>
|
646
|
+
<span class='kw'>end</span>
|
743
647
|
<span class='kw'>end</span></pre>
|
744
648
|
</td>
|
745
649
|
</tr>
|
@@ -751,7 +655,7 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
751
655
|
</div>
|
752
656
|
|
753
657
|
<div id="footer">
|
754
|
-
Generated on Sun Jan
|
658
|
+
Generated on Sun Jan 28 11:58:39 2018 by
|
755
659
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
756
660
|
0.9.12 (ruby-2.4.0).
|
757
661
|
</div>
|
@@ -281,7 +281,7 @@ We have already determined that this row must be present.</p>
|
|
281
281
|
</div>
|
282
282
|
|
283
283
|
<div id="footer">
|
284
|
-
Generated on Sun Jan
|
284
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
285
285
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
286
286
|
0.9.12 (ruby-2.4.0).
|
287
287
|
</div>
|
@@ -1137,7 +1137,7 @@ type, which is looked up in the above table.</p>
|
|
1137
1137
|
</div>
|
1138
1138
|
|
1139
1139
|
<div id="footer">
|
1140
|
-
Generated on Sun Jan
|
1140
|
+
Generated on Sun Jan 28 11:58:39 2018 by
|
1141
1141
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1142
1142
|
0.9.12 (ruby-2.4.0).
|
1143
1143
|
</div>
|
@@ -416,7 +416,7 @@ the header row.</p>
|
|
416
416
|
</div>
|
417
417
|
|
418
418
|
<div id="footer">
|
419
|
-
Generated on Sun Jan
|
419
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
420
420
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
421
421
|
0.9.12 (ruby-2.4.0).
|
422
422
|
</div>
|
data/doc/CSVDecision/Error.html
CHANGED
@@ -129,7 +129,7 @@
|
|
129
129
|
</div>
|
130
130
|
|
131
131
|
<div id="footer">
|
132
|
-
Generated on Sun Jan
|
132
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
133
133
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
134
134
|
0.9.12 (ruby-2.4.0).
|
135
135
|
</div>
|
@@ -133,7 +133,7 @@
|
|
133
133
|
</div>
|
134
134
|
|
135
135
|
<div id="footer">
|
136
|
-
Generated on Sun Jan
|
136
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
137
137
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
138
138
|
0.9.12 (ruby-2.4.0).
|
139
139
|
</div>
|
data/doc/CSVDecision/Header.html
CHANGED
@@ -637,7 +637,7 @@ method name - note any spaces will have been replaced with underscores.</p>
|
|
637
637
|
</div>
|
638
638
|
|
639
639
|
<div id="footer">
|
640
|
-
Generated on Sun Jan
|
640
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
641
641
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
642
642
|
0.9.12 (ruby-2.4.0).
|
643
643
|
</div>
|
data/doc/CSVDecision/Index.html
CHANGED
@@ -731,7 +731,7 @@ indexes.</p>
|
|
731
731
|
</div>
|
732
732
|
|
733
733
|
<div id="footer">
|
734
|
-
Generated on Sun Jan
|
734
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
735
735
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
736
736
|
0.9.12 (ruby-2.4.0).
|
737
737
|
</div>
|
data/doc/CSVDecision/Input.html
CHANGED
@@ -204,7 +204,7 @@
|
|
204
204
|
<span class='name'>symbolize_keys</span>
|
205
205
|
|
206
206
|
|
207
|
-
<span class='type'>(<tt>
|
207
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
208
208
|
|
209
209
|
|
210
210
|
|
@@ -268,7 +268,7 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
268
268
|
</div>
|
269
269
|
|
270
270
|
<div id="footer">
|
271
|
-
Generated on Sun Jan
|
271
|
+
Generated on Sun Jan 28 11:58:38 2018 by
|
272
272
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
273
273
|
0.9.12 (ruby-2.4.0).
|
274
274
|
</div>
|