csv_decision 0.0.9 → 0.1.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/benchmarks/rufus_decision.rb +3 -5
- data/csv_decision.gemspec +1 -3
- data/doc/CSVDecision/CellValidationError.html +1 -1
- data/doc/CSVDecision/Columns/Dictionary.html +112 -18
- data/doc/CSVDecision/Columns.html +112 -81
- data/doc/CSVDecision/Data.html +1 -1
- data/doc/CSVDecision/Decide.html +1 -1
- data/doc/CSVDecision/Decision.html +1 -1
- data/doc/CSVDecision/Dictionary/Entry.html +1 -1
- data/doc/CSVDecision/Dictionary.html +152 -7
- data/doc/CSVDecision/Error.html +1 -1
- data/doc/CSVDecision/FileError.html +1 -1
- data/doc/CSVDecision/Header.html +1 -1
- data/doc/CSVDecision/Input.html +5 -11
- data/doc/CSVDecision/Load.html +1 -1
- data/doc/CSVDecision/Matchers/Constant.html +1 -1
- data/doc/CSVDecision/Matchers/Function.html +1 -1
- data/doc/CSVDecision/Matchers/Guard.html +23 -23
- data/doc/CSVDecision/Matchers/Matcher.html +13 -13
- data/doc/CSVDecision/Matchers/Numeric.html +3 -3
- data/doc/CSVDecision/Matchers/Pattern.html +9 -11
- data/doc/CSVDecision/Matchers/Proc.html +571 -0
- data/doc/CSVDecision/Matchers/Range.html +1 -1
- data/doc/CSVDecision/Matchers/Symbol.html +1 -1
- data/doc/CSVDecision/Matchers.html +63 -83
- data/doc/CSVDecision/Options.html +1 -1
- data/doc/CSVDecision/Parse.html +115 -8
- data/doc/CSVDecision/Result.html +55 -37
- data/doc/CSVDecision/ScanRow.html +3 -3
- data/doc/CSVDecision/Table.html +5 -6
- data/doc/CSVDecision.html +5 -5
- data/doc/_index.html +12 -5
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +2 -2
- data/doc/index.html +2 -2
- data/doc/method_list.html +110 -46
- data/doc/top-level-namespace.html +1 -1
- data/lib/csv_decision/columns.rb +14 -9
- data/lib/csv_decision/dictionary.rb +46 -21
- data/lib/csv_decision/input.rb +13 -6
- data/lib/csv_decision/matchers/constant.rb +1 -1
- data/lib/csv_decision/matchers/guard.rb +7 -10
- data/lib/csv_decision/matchers/numeric.rb +2 -2
- data/lib/csv_decision/matchers/pattern.rb +1 -2
- data/lib/csv_decision/matchers/range.rb +1 -1
- data/lib/csv_decision/matchers/symbol.rb +1 -1
- data/lib/csv_decision/matchers.rb +38 -4
- data/lib/csv_decision/parse.rb +100 -5
- data/lib/csv_decision/result.rb +23 -7
- data/lib/csv_decision/table.rb +2 -2
- data/spec/csv_decision/columns_spec.rb +89 -0
- data/spec/csv_decision/examples_spec.rb +23 -1
- data/spec/csv_decision/input_spec.rb +0 -2
- data/spec/csv_decision/table_spec.rb +1 -1
- metadata +3 -30
@@ -122,7 +122,7 @@
|
|
122
122
|
|
123
123
|
|
124
124
|
|
125
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Matchers/Constant.html" title="CSVDecision::Matchers::Constant (class)">Constant</a></span>, <span class='object_link'><a href="Matchers/Function.html" title="CSVDecision::Matchers::Function (class)">Function</a></span>, <span class='object_link'><a href="Matchers/Guard.html" title="CSVDecision::Matchers::Guard (class)">Guard</a></span>, <span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matcher</a></span>, <span class='object_link'><a href="Matchers/Numeric.html" title="CSVDecision::Matchers::Numeric (class)">Numeric</a></span>, <span class='object_link'><a href="Matchers/Pattern.html" title="CSVDecision::Matchers::Pattern (class)">Pattern</a></span>, <span class='object_link'><a href="Matchers/Range.html" title="CSVDecision::Matchers::Range (class)">Range</a></span>, <span class='object_link'><a href="Matchers/Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span>
|
125
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Matchers/Constant.html" title="CSVDecision::Matchers::Constant (class)">Constant</a></span>, <span class='object_link'><a href="Matchers/Function.html" title="CSVDecision::Matchers::Function (class)">Function</a></span>, <span class='object_link'><a href="Matchers/Guard.html" title="CSVDecision::Matchers::Guard (class)">Guard</a></span>, <span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matcher</a></span>, <span class='object_link'><a href="Matchers/Numeric.html" title="CSVDecision::Matchers::Numeric (class)">Numeric</a></span>, <span class='object_link'><a href="Matchers/Pattern.html" title="CSVDecision::Matchers::Pattern (class)">Pattern</a></span>, <span class='object_link'><a href="Matchers/Proc.html" title="CSVDecision::Matchers::Proc (class)">Proc</a></span>, <span class='object_link'><a href="Matchers/Range.html" title="CSVDecision::Matchers::Range (class)">Range</a></span>, <span class='object_link'><a href="Matchers/Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span>
|
126
126
|
|
127
127
|
|
128
128
|
</p>
|
@@ -130,26 +130,6 @@
|
|
130
130
|
<h2>Constant Summary</h2>
|
131
131
|
<dl class="constants">
|
132
132
|
|
133
|
-
<dt id="Proc-constant" class="">Proc =
|
134
|
-
<div class="docstring">
|
135
|
-
<div class="discussion">
|
136
|
-
<p class="note private">
|
137
|
-
<strong>This constant is part of a private API.</strong>
|
138
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
139
|
-
</p>
|
140
|
-
|
141
|
-
<p>Value object for a data cell proc.</p>
|
142
|
-
|
143
|
-
|
144
|
-
</div>
|
145
|
-
</div>
|
146
|
-
<div class="tags">
|
147
|
-
|
148
|
-
|
149
|
-
</div>
|
150
|
-
</dt>
|
151
|
-
<dd><pre class="code"><span class='const'>Value</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:type</span><span class='comma'>,</span> <span class='symbol'>:function</span><span class='rparen'>)</span></pre></dd>
|
152
|
-
|
153
133
|
<dt id="NEGATE-constant" class="">NEGATE =
|
154
134
|
<div class="docstring">
|
155
135
|
<div class="discussion">
|
@@ -578,14 +558,14 @@ nil.</p>
|
|
578
558
|
<pre class="lines">
|
579
559
|
|
580
560
|
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
561
|
+
137
|
562
|
+
138
|
563
|
+
139
|
564
|
+
140
|
565
|
+
141</pre>
|
586
566
|
</td>
|
587
567
|
<td>
|
588
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
568
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 137</span>
|
589
569
|
|
590
570
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
591
571
|
<span class='ivar'>@matchers</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:matchers</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_klass'>klass</span><span class='op'>|</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
@@ -652,12 +632,12 @@ nil.</p>
|
|
652
632
|
<pre class="lines">
|
653
633
|
|
654
634
|
|
655
|
-
|
656
|
-
|
657
|
-
|
635
|
+
131
|
636
|
+
132
|
637
|
+
133</pre>
|
658
638
|
</td>
|
659
639
|
<td>
|
660
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
640
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 131</span>
|
661
641
|
|
662
642
|
<span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span>
|
663
643
|
<span class='ivar'>@ins</span>
|
@@ -717,12 +697,12 @@ nil.</p>
|
|
717
697
|
<pre class="lines">
|
718
698
|
|
719
699
|
|
720
|
-
|
721
|
-
|
722
|
-
|
700
|
+
134
|
701
|
+
135
|
702
|
+
136</pre>
|
723
703
|
</td>
|
724
704
|
<td>
|
725
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
705
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 134</span>
|
726
706
|
|
727
707
|
<span class='kw'>def</span> <span class='id identifier rubyid_outs'>outs</span>
|
728
708
|
<span class='ivar'>@outs</span>
|
@@ -797,12 +777,12 @@ nil.</p>
|
|
797
777
|
<pre class="lines">
|
798
778
|
|
799
779
|
|
800
|
-
|
801
|
-
|
802
|
-
|
780
|
+
73
|
781
|
+
74
|
782
|
+
75</pre>
|
803
783
|
</td>
|
804
784
|
<td>
|
805
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
785
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 73</span>
|
806
786
|
|
807
787
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_normalize_operator'>normalize_operator</span><span class='lparen'>(</span><span class='id identifier rubyid_operator'>operator</span><span class='rparen'>)</span>
|
808
788
|
<span class='const'>EQUALS_RE</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_operator'>operator</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>==</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='id identifier rubyid_operator'>operator</span>
|
@@ -871,15 +851,15 @@ valid numeric string.</p>
|
|
871
851
|
<pre class="lines">
|
872
852
|
|
873
853
|
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
854
|
+
93
|
855
|
+
94
|
856
|
+
95
|
857
|
+
96
|
858
|
+
97
|
859
|
+
98</pre>
|
880
860
|
</td>
|
881
861
|
<td>
|
882
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
862
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 93</span>
|
883
863
|
|
884
864
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
885
865
|
<span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_numeric?'>numeric?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
@@ -960,12 +940,12 @@ valid numeric string.</p>
|
|
960
940
|
<pre class="lines">
|
961
941
|
|
962
942
|
|
963
|
-
|
964
|
-
|
965
|
-
|
943
|
+
85
|
944
|
+
86
|
945
|
+
87</pre>
|
966
946
|
</td>
|
967
947
|
<td>
|
968
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
948
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 85</span>
|
969
949
|
|
970
950
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_numeric?'>numeric?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
971
951
|
<span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Integer</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>BigDecimal</span><span class='rparen'>)</span>
|
@@ -1071,21 +1051,21 @@ matchers.</p>
|
|
1071
1051
|
<pre class="lines">
|
1072
1052
|
|
1073
1053
|
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1054
|
+
117
|
1055
|
+
118
|
1056
|
+
119
|
1057
|
+
120
|
1058
|
+
121
|
1059
|
+
122
|
1060
|
+
123
|
1061
|
+
124
|
1062
|
+
125
|
1063
|
+
126
|
1064
|
+
127
|
1065
|
+
128</pre>
|
1086
1066
|
</td>
|
1087
1067
|
<td>
|
1088
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
1068
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 117</span>
|
1089
1069
|
|
1090
1070
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>matchers:</span><span class='comma'>,</span> <span class='label'>row:</span><span class='rparen'>)</span>
|
1091
1071
|
<span class='comment'># Build an array of column indexes requiring simple constant matches,
|
@@ -1173,12 +1153,12 @@ non-capturing group.</p>
|
|
1173
1153
|
<pre class="lines">
|
1174
1154
|
|
1175
1155
|
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1156
|
+
62
|
1157
|
+
63
|
1158
|
+
64</pre>
|
1179
1159
|
</td>
|
1180
1160
|
<td>
|
1181
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
1161
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 62</span>
|
1182
1162
|
|
1183
1163
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_regexp'>regexp</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
1184
1164
|
<span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\A(?:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>)\\z</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
@@ -1247,15 +1227,15 @@ nil.</p>
|
|
1247
1227
|
<pre class="lines">
|
1248
1228
|
|
1249
1229
|
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1230
|
+
104
|
1231
|
+
105
|
1232
|
+
106
|
1233
|
+
107
|
1234
|
+
108
|
1235
|
+
109</pre>
|
1256
1236
|
</td>
|
1257
1237
|
<td>
|
1258
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
1238
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 104</span>
|
1259
1239
|
|
1260
1240
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_numeric'>to_numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
1261
1241
|
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='id identifier rubyid_match'>match</span> <span class='op'>=</span> <span class='const'>NUMERIC_RE</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
@@ -1358,12 +1338,12 @@ nil.</p>
|
|
1358
1338
|
<pre class="lines">
|
1359
1339
|
|
1360
1340
|
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1341
|
+
148
|
1342
|
+
149
|
1343
|
+
150</pre>
|
1364
1344
|
</td>
|
1365
1345
|
<td>
|
1366
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
1346
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 148</span>
|
1367
1347
|
|
1368
1348
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse_ins'>parse_ins</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>row:</span><span class='rparen'>)</span>
|
1369
1349
|
<span class='const'><span class='object_link'><a href="" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="#parse-class_method" title="CSVDecision::Matchers.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='label'>columns:</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='label'>matchers:</span> <span class='ivar'>@ins</span><span class='comma'>,</span> <span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
|
@@ -1457,12 +1437,12 @@ nil.</p>
|
|
1457
1437
|
<pre class="lines">
|
1458
1438
|
|
1459
1439
|
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1440
|
+
157
|
1441
|
+
158
|
1442
|
+
159</pre>
|
1463
1443
|
</td>
|
1464
1444
|
<td>
|
1465
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
1445
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 157</span>
|
1466
1446
|
|
1467
1447
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse_outs'>parse_outs</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>row:</span><span class='rparen'>)</span>
|
1468
1448
|
<span class='const'><span class='object_link'><a href="" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="#parse-class_method" title="CSVDecision::Matchers.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='label'>columns:</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='label'>matchers:</span> <span class='ivar'>@outs</span><span class='comma'>,</span> <span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
|
@@ -1477,7 +1457,7 @@ nil.</p>
|
|
1477
1457
|
</div>
|
1478
1458
|
|
1479
1459
|
<div id="footer">
|
1480
|
-
Generated on
|
1460
|
+
Generated on Sat Jan 6 20:03:01 2018 by
|
1481
1461
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1482
1462
|
0.9.12 (ruby-2.4.0).
|
1483
1463
|
</div>
|
@@ -433,7 +433,7 @@ set.</p>
|
|
433
433
|
</div>
|
434
434
|
|
435
435
|
<div id="footer">
|
436
|
-
Generated on
|
436
|
+
Generated on Sat Jan 6 20:03:01 2018 by
|
437
437
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
438
438
|
0.9.12 (ruby-2.4.0).
|
439
439
|
</div>
|
data/doc/CSVDecision/Parse.html
CHANGED
@@ -116,6 +116,28 @@
|
|
116
116
|
<li class="public ">
|
117
117
|
<span class="summary_signature">
|
118
118
|
|
119
|
+
<a href="#invalid_out_ref%3F-class_method" title="invalid_out_ref? (class method)">.<strong>invalid_out_ref?</strong>(columns, index, in_out) ⇒ Boolean </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<span class="private note title">private</span>
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
134
|
+
|
135
|
+
</li>
|
136
|
+
|
137
|
+
|
138
|
+
<li class="public ">
|
139
|
+
<span class="summary_signature">
|
140
|
+
|
119
141
|
<a href="#table-class_method" title="table (class method)">.<strong>table</strong>(data:, options:) ⇒ CSVDecision::Table </a>
|
120
142
|
|
121
143
|
|
@@ -147,7 +169,92 @@
|
|
147
169
|
|
148
170
|
|
149
171
|
<div class="method_details first">
|
150
|
-
<h3 class="signature first" id="
|
172
|
+
<h3 class="signature first" id="invalid_out_ref?-class_method">
|
173
|
+
|
174
|
+
.<strong>invalid_out_ref?</strong>(columns, index, in_out) ⇒ <tt>Boolean</tt>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
</h3><div class="docstring">
|
181
|
+
<div class="discussion">
|
182
|
+
<p class="note private">
|
183
|
+
<strong>This method is part of a private API.</strong>
|
184
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
185
|
+
</p>
|
186
|
+
|
187
|
+
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
<div class="tags">
|
191
|
+
|
192
|
+
<p class="tag_title">Returns:</p>
|
193
|
+
<ul class="return">
|
194
|
+
|
195
|
+
<li>
|
196
|
+
|
197
|
+
|
198
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
</ul>
|
205
|
+
<p class="tag_title">Raises:</p>
|
206
|
+
<ul class="raise">
|
207
|
+
|
208
|
+
<li>
|
209
|
+
|
210
|
+
|
211
|
+
<span class='type'>(<tt><span class='object_link'><a href="CellValidationError.html" title="CSVDecision::CellValidationError (class)">CellValidationError</a></span></tt>)</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
</ul>
|
218
|
+
|
219
|
+
</div><table class="source_code">
|
220
|
+
<tr>
|
221
|
+
<td>
|
222
|
+
<pre class="lines">
|
223
|
+
|
224
|
+
|
225
|
+
181
|
226
|
+
182
|
227
|
+
183
|
228
|
+
184
|
229
|
+
185
|
230
|
+
186
|
231
|
+
187
|
232
|
+
188
|
233
|
+
189
|
234
|
+
190
|
235
|
+
191</pre>
|
236
|
+
</td>
|
237
|
+
<td>
|
238
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/parse.rb', line 181</span>
|
239
|
+
|
240
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_invalid_out_ref?'>invalid_out_ref?</span><span class='lparen'>(</span><span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='comma'>,</span> <span class='id identifier rubyid_in_out'>in_out</span><span class='rparen'>)</span>
|
241
|
+
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_in_out'>in_out</span> <span class='op'><</span> <span class='id identifier rubyid_index'>index</span>
|
242
|
+
|
243
|
+
<span class='id identifier rubyid_that_column'>that_column</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_in_out'>in_out</span> <span class='op'>==</span> <span class='id identifier rubyid_index'>index</span>
|
244
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>reference to itself</span><span class='tstring_end'>'</span></span>
|
245
|
+
<span class='kw'>else</span>
|
246
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>an out of order reference to output column '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_outs'>outs</span><span class='lbracket'>[</span><span class='id identifier rubyid_in_out'>in_out</span><span class='rbracket'>]</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='tstring_end'>"</span></span>
|
247
|
+
<span class='kw'>end</span>
|
248
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="CellValidationError.html" title="CSVDecision::CellValidationError (class)">CellValidationError</a></span></span><span class='comma'>,</span>
|
249
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>output column '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_outs'>outs</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>' makes </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_that_column'>that_column</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
250
|
+
<span class='kw'>end</span></pre>
|
251
|
+
</td>
|
252
|
+
</tr>
|
253
|
+
</table>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
<div class="method_details ">
|
257
|
+
<h3 class="signature " id="table-class_method">
|
151
258
|
|
152
259
|
.<strong>table</strong>(data:, options:) ⇒ <tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>
|
153
260
|
|
@@ -230,6 +337,9 @@
|
|
230
337
|
<pre class="lines">
|
231
338
|
|
232
339
|
|
340
|
+
54
|
341
|
+
55
|
342
|
+
56
|
233
343
|
57
|
234
344
|
58
|
235
345
|
59
|
@@ -240,13 +350,10 @@
|
|
240
350
|
64
|
241
351
|
65
|
242
352
|
66
|
243
|
-
67
|
244
|
-
68
|
245
|
-
69
|
246
|
-
70</pre>
|
353
|
+
67</pre>
|
247
354
|
</td>
|
248
355
|
<td>
|
249
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/parse.rb', line
|
356
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/parse.rb', line 54</span>
|
250
357
|
|
251
358
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='label'>data:</span><span class='comma'>,</span> <span class='label'>options:</span><span class='rparen'>)</span>
|
252
359
|
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">Table</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Table.html#initialize-instance_method" title="CSVDecision::Table#initialize (method)">new</a></span></span>
|
@@ -257,7 +364,7 @@
|
|
257
364
|
<span class='id identifier rubyid_parse_table'>parse_table</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_data'>data</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
258
365
|
|
259
366
|
<span class='comment'># The table object is now immutable.
|
260
|
-
</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
|
367
|
+
</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_freeze'>freeze</span>
|
261
368
|
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
262
369
|
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="CSVDecision::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_exp'>exp</span>
|
263
370
|
<span class='id identifier rubyid_raise_error'>raise_error</span><span class='lparen'>(</span><span class='label'>file:</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='label'>exception:</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
@@ -272,7 +379,7 @@
|
|
272
379
|
</div>
|
273
380
|
|
274
381
|
<div id="footer">
|
275
|
-
Generated on
|
382
|
+
Generated on Sat Jan 6 20:03:01 2018 by
|
276
383
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
277
384
|
0.9.12 (ruby-2.4.0).
|
278
385
|
</div>
|