csv_decision 0.2.0 → 0.3.0
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/README.md +11 -8
- data/benchmarks/rufus_decision.rb +9 -1
- data/csv_decision.gemspec +1 -1
- data/doc/CSVDecision/CellValidationError.html +1 -1
- data/doc/CSVDecision/Columns/Dictionary.html +29 -29
- data/doc/CSVDecision/Columns.html +394 -47
- data/doc/CSVDecision/Data.html +2 -2
- data/doc/CSVDecision/Decide.html +23 -159
- data/doc/CSVDecision/Decision.html +370 -32
- data/doc/CSVDecision/Defaults.html +1 -1
- data/doc/CSVDecision/Dictionary/Entry.html +157 -55
- data/doc/CSVDecision/Dictionary.html +37 -21
- data/doc/CSVDecision/Error.html +1 -1
- data/doc/CSVDecision/FileError.html +1 -1
- data/doc/CSVDecision/Header.html +142 -1
- data/doc/CSVDecision/Index.html +741 -0
- data/doc/CSVDecision/Input.html +14 -61
- 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 +13 -147
- data/doc/CSVDecision/Matchers/Matcher.html +13 -13
- data/doc/CSVDecision/Matchers/Numeric.html +1 -1
- data/doc/CSVDecision/Matchers/Pattern.html +1 -1
- data/doc/CSVDecision/Matchers/Proc.html +147 -14
- data/doc/CSVDecision/Matchers/Range.html +1 -1
- data/doc/CSVDecision/Matchers/Symbol.html +1 -1
- data/doc/CSVDecision/Matchers.html +55 -162
- data/doc/CSVDecision/Options.html +21 -21
- data/doc/CSVDecision/Parse.html +2 -180
- data/doc/CSVDecision/Result.html +220 -38
- data/doc/CSVDecision/ScanRow.html +69 -325
- data/doc/CSVDecision/Table.html +128 -40
- data/doc/CSVDecision/TableValidationError.html +1 -1
- data/doc/CSVDecision/Validate.html +1 -1
- data/doc/CSVDecision.html +4 -4
- data/doc/_index.html +8 -8
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +13 -11
- data/doc/index.html +13 -11
- data/doc/method_list.html +206 -150
- data/doc/top-level-namespace.html +1 -1
- data/lib/csv_decision/columns.rb +87 -1
- data/lib/csv_decision/decision.rb +54 -29
- data/lib/csv_decision/defaults.rb +1 -1
- data/lib/csv_decision/dictionary.rb +32 -22
- data/lib/csv_decision/header.rb +17 -0
- data/lib/csv_decision/index.rb +107 -0
- data/lib/csv_decision/input.rb +45 -13
- data/lib/csv_decision/matchers/guard.rb +2 -0
- data/lib/csv_decision/matchers.rb +14 -8
- data/lib/csv_decision/options.rb +7 -19
- data/lib/csv_decision/parse.rb +12 -96
- data/lib/csv_decision/result.rb +10 -9
- data/lib/csv_decision/scan_row.rb +20 -44
- data/lib/csv_decision/table.rb +7 -4
- data/lib/csv_decision.rb +1 -1
- data/spec/csv_decision/columns_spec.rb +6 -6
- data/spec/csv_decision/data_spec.rb +0 -5
- data/spec/csv_decision/index_spec.rb +58 -0
- data/spec/csv_decision/input_spec.rb +7 -2
- data/spec/csv_decision/options_spec.rb +16 -1
- data/spec/csv_decision/parse_spec.rb +4 -5
- data/spec/csv_decision/table_spec.rb +70 -0
- data/spec/data/{valid → invalid}/empty.csv +0 -0
- data/spec/data/valid/index_example.csv +12 -0
- data/spec/data/valid/multi_column_index.csv +10 -0
- data/spec/data/valid/multi_column_index2.csv +12 -0
- data/spec/data/valid/options_in_file3.csv +13 -0
- metadata +16 -5
- data/lib/csv_decision/decide.rb +0 -45
@@ -369,7 +369,7 @@ some type of function.</p>
|
|
369
369
|
</div>
|
370
370
|
|
371
371
|
<div id="footer">
|
372
|
-
Generated on Sat Jan
|
372
|
+
Generated on Sat Jan 20 15:44:36 2018 by
|
373
373
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
374
374
|
0.9.12 (ruby-2.4.0).
|
375
375
|
</div>
|
@@ -415,7 +415,7 @@ some type of function.</p>
|
|
415
415
|
</div>
|
416
416
|
|
417
417
|
<div id="footer">
|
418
|
-
Generated on Sat Jan
|
418
|
+
Generated on Sat Jan 20 15:44:36 2018 by
|
419
419
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
420
420
|
0.9.12 (ruby-2.4.0).
|
421
421
|
</div>
|
@@ -317,30 +317,6 @@ decimal point.</p>
|
|
317
317
|
valid numeric string.</p>
|
318
318
|
</div></span>
|
319
319
|
|
320
|
-
</li>
|
321
|
-
|
322
|
-
|
323
|
-
<li class="public ">
|
324
|
-
<span class="summary_signature">
|
325
|
-
|
326
|
-
<a href="#numeric%3F-class_method" title="numeric? (class method)">.<strong>numeric?</strong>(value) ⇒ Boolean </a>
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
</span>
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
<span class="private note title">private</span>
|
338
|
-
|
339
|
-
|
340
|
-
<span class="summary_desc"><div class='inline'>
|
341
|
-
<p>Return true if value is an Integer or a BigDecimal, false otherwise.</p>
|
342
|
-
</div></span>
|
343
|
-
|
344
320
|
</li>
|
345
321
|
|
346
322
|
|
@@ -558,14 +534,14 @@ nil.</p>
|
|
558
534
|
<pre class="lines">
|
559
535
|
|
560
536
|
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
537
|
+
143
|
538
|
+
144
|
539
|
+
145
|
540
|
+
146
|
541
|
+
147</pre>
|
566
542
|
</td>
|
567
543
|
<td>
|
568
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
544
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 143</span>
|
569
545
|
|
570
546
|
<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>
|
571
547
|
<span class='id identifier rubyid_matchers'>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>
|
@@ -632,12 +608,12 @@ nil.</p>
|
|
632
608
|
<pre class="lines">
|
633
609
|
|
634
610
|
|
635
|
-
|
636
|
-
|
637
|
-
|
611
|
+
137
|
612
|
+
138
|
613
|
+
139</pre>
|
638
614
|
</td>
|
639
615
|
<td>
|
640
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
616
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 137</span>
|
641
617
|
|
642
618
|
<span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span>
|
643
619
|
<span class='ivar'>@ins</span>
|
@@ -697,12 +673,12 @@ nil.</p>
|
|
697
673
|
<pre class="lines">
|
698
674
|
|
699
675
|
|
700
|
-
|
701
|
-
|
702
|
-
|
676
|
+
140
|
677
|
+
141
|
678
|
+
142</pre>
|
703
679
|
</td>
|
704
680
|
<td>
|
705
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
681
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 140</span>
|
706
682
|
|
707
683
|
<span class='kw'>def</span> <span class='id identifier rubyid_outs'>outs</span>
|
708
684
|
<span class='ivar'>@outs</span>
|
@@ -777,12 +753,12 @@ nil.</p>
|
|
777
753
|
<pre class="lines">
|
778
754
|
|
779
755
|
|
780
|
-
|
781
|
-
|
782
|
-
|
756
|
+
85
|
757
|
+
86
|
758
|
+
87</pre>
|
783
759
|
</td>
|
784
760
|
<td>
|
785
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
761
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 85</span>
|
786
762
|
|
787
763
|
<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>
|
788
764
|
<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>
|
@@ -851,18 +827,18 @@ valid numeric string.</p>
|
|
851
827
|
<pre class="lines">
|
852
828
|
|
853
829
|
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
830
|
+
99
|
831
|
+
100
|
832
|
+
101
|
833
|
+
102
|
834
|
+
103
|
835
|
+
104</pre>
|
860
836
|
</td>
|
861
837
|
<td>
|
862
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
838
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 99</span>
|
863
839
|
|
864
840
|
<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>
|
865
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='id identifier
|
841
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</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'>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>
|
866
842
|
<span class='kw'>return</span> <span class='kw'>unless</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'>String</span><span class='rparen'>)</span>
|
867
843
|
|
868
844
|
<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>
|
@@ -870,89 +846,6 @@ valid numeric string.</p>
|
|
870
846
|
</td>
|
871
847
|
</tr>
|
872
848
|
</table>
|
873
|
-
</div>
|
874
|
-
|
875
|
-
<div class="method_details ">
|
876
|
-
<h3 class="signature " id="numeric?-class_method">
|
877
|
-
|
878
|
-
.<strong>numeric?</strong>(value) ⇒ <tt>Boolean</tt>
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
</h3><div class="docstring">
|
885
|
-
<div class="discussion">
|
886
|
-
<p class="note private">
|
887
|
-
<strong>This method is part of a private API.</strong>
|
888
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
889
|
-
</p>
|
890
|
-
|
891
|
-
<p>Return true if value is an Integer or a BigDecimal, false otherwise.</p>
|
892
|
-
|
893
|
-
|
894
|
-
</div>
|
895
|
-
</div>
|
896
|
-
<div class="tags">
|
897
|
-
<p class="tag_title">Parameters:</p>
|
898
|
-
<ul class="param">
|
899
|
-
|
900
|
-
<li>
|
901
|
-
|
902
|
-
<span class='name'>value</span>
|
903
|
-
|
904
|
-
|
905
|
-
<span class='type'>(<tt>Object</tt>)</span>
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
—
|
910
|
-
<div class='inline'>
|
911
|
-
<p>Value from the input hash.</p>
|
912
|
-
</div>
|
913
|
-
|
914
|
-
</li>
|
915
|
-
|
916
|
-
</ul>
|
917
|
-
|
918
|
-
<p class="tag_title">Returns:</p>
|
919
|
-
<ul class="return">
|
920
|
-
|
921
|
-
<li>
|
922
|
-
|
923
|
-
|
924
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
—
|
929
|
-
<div class='inline'>
|
930
|
-
<p>Return true if value is an Integer or a BigDecimal, false otherwise.</p>
|
931
|
-
</div>
|
932
|
-
|
933
|
-
</li>
|
934
|
-
|
935
|
-
</ul>
|
936
|
-
|
937
|
-
</div><table class="source_code">
|
938
|
-
<tr>
|
939
|
-
<td>
|
940
|
-
<pre class="lines">
|
941
|
-
|
942
|
-
|
943
|
-
85
|
944
|
-
86
|
945
|
-
87</pre>
|
946
|
-
</td>
|
947
|
-
<td>
|
948
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 85</span>
|
949
|
-
|
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>
|
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>
|
952
|
-
<span class='kw'>end</span></pre>
|
953
|
-
</td>
|
954
|
-
</tr>
|
955
|
-
</table>
|
956
849
|
</div>
|
957
850
|
|
958
851
|
<div class="method_details ">
|
@@ -1051,21 +944,21 @@ matchers.</p>
|
|
1051
944
|
<pre class="lines">
|
1052
945
|
|
1053
946
|
|
1054
|
-
117
|
1055
|
-
118
|
1056
|
-
119
|
1057
|
-
120
|
1058
|
-
121
|
1059
|
-
122
|
1060
947
|
123
|
1061
948
|
124
|
1062
949
|
125
|
1063
950
|
126
|
1064
951
|
127
|
1065
|
-
128
|
952
|
+
128
|
953
|
+
129
|
954
|
+
130
|
955
|
+
131
|
956
|
+
132
|
957
|
+
133
|
958
|
+
134</pre>
|
1066
959
|
</td>
|
1067
960
|
<td>
|
1068
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
961
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 123</span>
|
1069
962
|
|
1070
963
|
<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>
|
1071
964
|
<span class='comment'># Build an array of column indexes requiring simple constant matches,
|
@@ -1077,7 +970,7 @@ matchers.</p>
|
|
1077
970
|
</span> <span class='comment'># Convert values in the data row if not just a simple constant.
|
1078
971
|
</span> <span class='id identifier rubyid_row'>row</span> <span class='op'>=</span> <span class='id identifier rubyid_scan_row'>scan_row</span><span class='period'>.</span><span class='id identifier rubyid_scan_columns'>scan_columns</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='id identifier rubyid_matchers'>matchers</span><span class='comma'>,</span> <span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
|
1079
972
|
|
1080
|
-
<span class='lbracket'>[</span><span class='id identifier rubyid_row'>row</span><span class='comma'>,</span> <span class='id identifier rubyid_scan_row'>scan_row</span><span class='
|
973
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_row'>row</span><span class='comma'>,</span> <span class='id identifier rubyid_scan_row'>scan_row</span><span class='rbracket'>]</span>
|
1081
974
|
<span class='kw'>end</span></pre>
|
1082
975
|
</td>
|
1083
976
|
</tr>
|
@@ -1153,12 +1046,12 @@ non-capturing group.</p>
|
|
1153
1046
|
<pre class="lines">
|
1154
1047
|
|
1155
1048
|
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1049
|
+
71
|
1050
|
+
72
|
1051
|
+
73</pre>
|
1159
1052
|
</td>
|
1160
1053
|
<td>
|
1161
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
1054
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 71</span>
|
1162
1055
|
|
1163
1056
|
<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>
|
1164
1057
|
<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>
|
@@ -1227,15 +1120,15 @@ nil.</p>
|
|
1227
1120
|
<pre class="lines">
|
1228
1121
|
|
1229
1122
|
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1123
|
+
110
|
1124
|
+
111
|
1125
|
+
112
|
1126
|
+
113
|
1127
|
+
114
|
1128
|
+
115</pre>
|
1236
1129
|
</td>
|
1237
1130
|
<td>
|
1238
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
1131
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 110</span>
|
1239
1132
|
|
1240
1133
|
<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>
|
1241
1134
|
<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>
|
@@ -1338,12 +1231,12 @@ nil.</p>
|
|
1338
1231
|
<pre class="lines">
|
1339
1232
|
|
1340
1233
|
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1234
|
+
154
|
1235
|
+
155
|
1236
|
+
156</pre>
|
1344
1237
|
</td>
|
1345
1238
|
<td>
|
1346
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
1239
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 154</span>
|
1347
1240
|
|
1348
1241
|
<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>
|
1349
1242
|
<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>
|
@@ -1437,12 +1330,12 @@ nil.</p>
|
|
1437
1330
|
<pre class="lines">
|
1438
1331
|
|
1439
1332
|
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1333
|
+
163
|
1334
|
+
164
|
1335
|
+
165</pre>
|
1443
1336
|
</td>
|
1444
1337
|
<td>
|
1445
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line
|
1338
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 163</span>
|
1446
1339
|
|
1447
1340
|
<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>
|
1448
1341
|
<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>
|
@@ -1457,7 +1350,7 @@ nil.</p>
|
|
1457
1350
|
</div>
|
1458
1351
|
|
1459
1352
|
<div id="footer">
|
1460
|
-
Generated on Sat Jan
|
1353
|
+
Generated on Sat Jan 20 15:44:35 2018 by
|
1461
1354
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1462
1355
|
0.9.12 (ruby-2.4.0).
|
1463
1356
|
</div>
|
@@ -289,22 +289,22 @@ set.</p>
|
|
289
289
|
<pre class="lines">
|
290
290
|
|
291
291
|
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
292
|
+
56
|
293
|
+
57
|
294
|
+
58
|
295
|
+
59
|
296
|
+
60
|
297
|
+
61
|
298
|
+
62
|
299
|
+
63
|
300
|
+
64
|
301
|
+
65
|
302
|
+
66
|
303
|
+
67
|
304
|
+
68</pre>
|
305
305
|
</td>
|
306
306
|
<td>
|
307
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/options.rb', line
|
307
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/options.rb', line 56</span>
|
308
308
|
|
309
309
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_from_csv'>from_csv</span><span class='lparen'>(</span><span class='label'>rows:</span><span class='comma'>,</span> <span class='label'>options:</span><span class='rparen'>)</span>
|
310
310
|
<span class='id identifier rubyid_row'>row</span> <span class='op'>=</span> <span class='id identifier rubyid_rows'>rows</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
@@ -392,7 +392,7 @@ set.</p>
|
|
392
392
|
<li>
|
393
393
|
|
394
394
|
|
395
|
-
<span class='type'>(<tt>
|
395
|
+
<span class='type'>(<tt><span class='object_link'><a href="CellValidationError.html" title="CSVDecision::CellValidationError (class)">CellValidationError</a></span></tt>)</span>
|
396
396
|
|
397
397
|
|
398
398
|
|
@@ -411,13 +411,13 @@ set.</p>
|
|
411
411
|
<pre class="lines">
|
412
412
|
|
413
413
|
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
414
|
+
46
|
415
|
+
47
|
416
|
+
48
|
417
|
+
49</pre>
|
418
418
|
</td>
|
419
419
|
<td>
|
420
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/options.rb', line
|
420
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/options.rb', line 46</span>
|
421
421
|
|
422
422
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_normalize'>normalize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
423
423
|
<span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
@@ -433,7 +433,7 @@ set.</p>
|
|
433
433
|
</div>
|
434
434
|
|
435
435
|
<div id="footer">
|
436
|
-
Generated on Sat Jan
|
436
|
+
Generated on Sat Jan 20 15:44:34 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,50 +116,6 @@
|
|
116
116
|
<li class="public ">
|
117
117
|
<span class="summary_signature">
|
118
118
|
|
119
|
-
<a href="#ins_cell_dictionary-class_method" title="ins_cell_dictionary (class method)">.<strong>ins_cell_dictionary</strong>(columns:, cell:) ⇒ Object </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
|
-
|
141
|
-
<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>
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
</span>
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
<span class="private note title">private</span>
|
153
|
-
|
154
|
-
|
155
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
156
|
-
|
157
|
-
</li>
|
158
|
-
|
159
|
-
|
160
|
-
<li class="public ">
|
161
|
-
<span class="summary_signature">
|
162
|
-
|
163
119
|
<a href="#table-class_method" title="table (class method)">.<strong>table</strong>(data:, options:) ⇒ CSVDecision::Table </a>
|
164
120
|
|
165
121
|
|
@@ -191,141 +147,7 @@
|
|
191
147
|
|
192
148
|
|
193
149
|
<div class="method_details first">
|
194
|
-
<h3 class="signature first" id="
|
195
|
-
|
196
|
-
.<strong>ins_cell_dictionary</strong>(columns:, cell:) ⇒ <tt>Object</tt>
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
</h3><div class="docstring">
|
203
|
-
<div class="discussion">
|
204
|
-
<p class="note private">
|
205
|
-
<strong>This method is part of a private API.</strong>
|
206
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
207
|
-
</p>
|
208
|
-
|
209
|
-
|
210
|
-
</div>
|
211
|
-
</div>
|
212
|
-
<div class="tags">
|
213
|
-
|
214
|
-
|
215
|
-
</div><table class="source_code">
|
216
|
-
<tr>
|
217
|
-
<td>
|
218
|
-
<pre class="lines">
|
219
|
-
|
220
|
-
|
221
|
-
219
|
222
|
-
220
|
223
|
-
221
|
224
|
-
222
|
225
|
-
223
|
226
|
-
224</pre>
|
227
|
-
</td>
|
228
|
-
<td>
|
229
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/parse.rb', line 219</span>
|
230
|
-
|
231
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_ins_cell_dictionary'>ins_cell_dictionary</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>cell:</span><span class='rparen'>)</span>
|
232
|
-
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_cell'>cell</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Proc.html" title="CSVDecision::Matchers::Proc (class)">Proc</a></span></span><span class='rparen'>)</span>
|
233
|
-
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_cell'>cell</span><span class='period'>.</span><span class='id identifier rubyid_symbols'>symbols</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
234
|
-
|
235
|
-
<span class='id identifier rubyid_add_ins_symbols'>add_ins_symbols</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'>cell:</span> <span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span>
|
236
|
-
<span class='kw'>end</span></pre>
|
237
|
-
</td>
|
238
|
-
</tr>
|
239
|
-
</table>
|
240
|
-
</div>
|
241
|
-
|
242
|
-
<div class="method_details ">
|
243
|
-
<h3 class="signature " id="invalid_out_ref?-class_method">
|
244
|
-
|
245
|
-
.<strong>invalid_out_ref?</strong>(columns, index, in_out) ⇒ <tt>Boolean</tt>
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
</h3><div class="docstring">
|
252
|
-
<div class="discussion">
|
253
|
-
<p class="note private">
|
254
|
-
<strong>This method is part of a private API.</strong>
|
255
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
256
|
-
</p>
|
257
|
-
|
258
|
-
|
259
|
-
</div>
|
260
|
-
</div>
|
261
|
-
<div class="tags">
|
262
|
-
|
263
|
-
<p class="tag_title">Returns:</p>
|
264
|
-
<ul class="return">
|
265
|
-
|
266
|
-
<li>
|
267
|
-
|
268
|
-
|
269
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
</li>
|
274
|
-
|
275
|
-
</ul>
|
276
|
-
<p class="tag_title">Raises:</p>
|
277
|
-
<ul class="raise">
|
278
|
-
|
279
|
-
<li>
|
280
|
-
|
281
|
-
|
282
|
-
<span class='type'>(<tt><span class='object_link'><a href="CellValidationError.html" title="CSVDecision::CellValidationError (class)">CellValidationError</a></span></tt>)</span>
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
</li>
|
287
|
-
|
288
|
-
</ul>
|
289
|
-
|
290
|
-
</div><table class="source_code">
|
291
|
-
<tr>
|
292
|
-
<td>
|
293
|
-
<pre class="lines">
|
294
|
-
|
295
|
-
|
296
|
-
202
|
297
|
-
203
|
298
|
-
204
|
299
|
-
205
|
300
|
-
206
|
301
|
-
207
|
302
|
-
208
|
303
|
-
209
|
304
|
-
210
|
305
|
-
211
|
306
|
-
212</pre>
|
307
|
-
</td>
|
308
|
-
<td>
|
309
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/parse.rb', line 202</span>
|
310
|
-
|
311
|
-
<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>
|
312
|
-
<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>
|
313
|
-
|
314
|
-
<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>
|
315
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>reference to itself</span><span class='tstring_end'>'</span></span>
|
316
|
-
<span class='kw'>else</span>
|
317
|
-
<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>
|
318
|
-
<span class='kw'>end</span>
|
319
|
-
<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>
|
320
|
-
<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>
|
321
|
-
<span class='kw'>end</span></pre>
|
322
|
-
</td>
|
323
|
-
</tr>
|
324
|
-
</table>
|
325
|
-
</div>
|
326
|
-
|
327
|
-
<div class="method_details ">
|
328
|
-
<h3 class="signature " id="table-class_method">
|
150
|
+
<h3 class="signature first" id="table-class_method">
|
329
151
|
|
330
152
|
.<strong>table</strong>(data:, options:) ⇒ <tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>
|
331
153
|
|
@@ -450,7 +272,7 @@
|
|
450
272
|
</div>
|
451
273
|
|
452
274
|
<div id="footer">
|
453
|
-
Generated on Sat Jan
|
275
|
+
Generated on Sat Jan 20 15:44:34 2018 by
|
454
276
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
455
277
|
0.9.12 (ruby-2.4.0).
|
456
278
|
</div>
|