csv_decision 0.4.1 → 0.5.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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +43 -19
  4. data/csv_decision.gemspec +1 -1
  5. data/doc/CSVDecision.html +6 -6
  6. data/doc/CSVDecision/CellValidationError.html +1 -1
  7. data/doc/CSVDecision/Columns.html +124 -42
  8. data/doc/CSVDecision/Columns/Dictionary.html +101 -7
  9. data/doc/CSVDecision/Data.html +1 -1
  10. data/doc/CSVDecision/Decision.html +444 -98
  11. data/doc/CSVDecision/Defaults.html +1 -1
  12. data/doc/CSVDecision/Dictionary.html +4 -4
  13. data/doc/CSVDecision/Dictionary/Entry.html +31 -31
  14. data/doc/CSVDecision/Error.html +1 -1
  15. data/doc/CSVDecision/FileError.html +1 -1
  16. data/doc/CSVDecision/Header.html +2 -2
  17. data/doc/CSVDecision/Index.html +1 -1
  18. data/doc/CSVDecision/Input.html +129 -3
  19. data/doc/CSVDecision/Load.html +1 -1
  20. data/doc/CSVDecision/Matchers.html +168 -41
  21. data/doc/CSVDecision/Matchers/Constant.html +7 -7
  22. data/doc/CSVDecision/Matchers/Function.html +1 -1
  23. data/doc/CSVDecision/Matchers/Guard.html +16 -16
  24. data/doc/CSVDecision/Matchers/Matcher.html +13 -13
  25. data/doc/CSVDecision/Matchers/Numeric.html +8 -14
  26. data/doc/CSVDecision/Matchers/Pattern.html +10 -10
  27. data/doc/CSVDecision/Matchers/Proc.html +1 -1
  28. data/doc/CSVDecision/Matchers/Range.html +1 -1
  29. data/doc/CSVDecision/Matchers/Symbol.html +19 -29
  30. data/doc/CSVDecision/Options.html +1 -1
  31. data/doc/CSVDecision/Parse.html +4 -4
  32. data/doc/CSVDecision/Paths.html +742 -0
  33. data/doc/CSVDecision/Result.html +139 -70
  34. data/doc/CSVDecision/Scan.html +313 -0
  35. data/doc/CSVDecision/Scan/InputHashes.html +369 -0
  36. data/doc/CSVDecision/ScanRow.html +1 -1
  37. data/doc/CSVDecision/Table.html +134 -52
  38. data/doc/CSVDecision/TableValidationError.html +1 -1
  39. data/doc/CSVDecision/Validate.html +1 -1
  40. data/doc/_index.html +26 -5
  41. data/doc/class_list.html +1 -1
  42. data/doc/file.README.html +50 -28
  43. data/doc/index.html +50 -28
  44. data/doc/method_list.html +234 -98
  45. data/doc/top-level-namespace.html +1 -1
  46. data/lib/csv_decision.rb +3 -0
  47. data/lib/csv_decision/columns.rb +11 -0
  48. data/lib/csv_decision/decision.rb +82 -56
  49. data/lib/csv_decision/dictionary.rb +5 -1
  50. data/lib/csv_decision/header.rb +1 -1
  51. data/lib/csv_decision/input.rb +14 -11
  52. data/lib/csv_decision/parse.rb +6 -2
  53. data/lib/csv_decision/paths.rb +78 -0
  54. data/lib/csv_decision/result.rb +42 -35
  55. data/lib/csv_decision/scan.rb +116 -0
  56. data/lib/csv_decision/table.rb +18 -7
  57. data/lib/csv_decision/validate.rb +1 -1
  58. data/spec/csv_decision/columns_spec.rb +14 -0
  59. data/spec/csv_decision/decision_spec.rb +1 -3
  60. data/spec/csv_decision/examples_spec.rb +25 -0
  61. data/spec/csv_decision/table_spec.rb +87 -0
  62. metadata +7 -2
@@ -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 28 14:41:48 2018 by
284
+ Generated on Sun Feb 11 10:26:07 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>
@@ -388,16 +388,16 @@ the header row.</p>
388
388
  <pre class="lines">
389
389
 
390
390
 
391
- 120
392
391
  121
393
392
  122
394
393
  123
395
394
  124
396
395
  125
397
- 126</pre>
396
+ 126
397
+ 127</pre>
398
398
  </td>
399
399
  <td>
400
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 120</span>
400
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 121</span>
401
401
 
402
402
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_build'>build</span><span class='lparen'>(</span><span class='label'>header:</span><span class='comma'>,</span> <span class='label'>dictionary:</span><span class='rparen'>)</span>
403
403
  <span class='id identifier rubyid_header'>header</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_cell'>cell</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
@@ -416,7 +416,7 @@ the header row.</p>
416
416
  </div>
417
417
 
418
418
  <div id="footer">
419
- Generated on Sun Jan 28 14:41:48 2018 by
419
+ Generated on Sun Feb 11 10:26:07 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>
@@ -448,7 +448,6 @@ type, which is looked up in the above table.</p>
448
448
  <pre class="lines">
449
449
 
450
450
 
451
- 91
452
451
  92
453
452
  93
454
453
  94
@@ -456,10 +455,11 @@ type, which is looked up in the above table.</p>
456
455
  96
457
456
  97
458
457
  98
459
- 99</pre>
458
+ 99
459
+ 100</pre>
460
460
  </td>
461
461
  <td>
462
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 91</span>
462
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 92</span>
463
463
 
464
464
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>name:</span><span class='comma'>,</span> <span class='label'>type:</span><span class='comma'>,</span> <span class='label'>eval:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>set_if:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>indexed:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
465
465
  <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
@@ -532,12 +532,12 @@ it only contains constants.</p>
532
532
  <pre class="lines">
533
533
 
534
534
 
535
- 75
536
535
  76
537
- 77</pre>
536
+ 77
537
+ 78</pre>
538
538
  </td>
539
539
  <td>
540
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 75</span>
540
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 76</span>
541
541
 
542
542
  <span class='kw'>def</span> <span class='id identifier rubyid_eval'>eval</span>
543
543
  <span class='ivar'>@eval</span>
@@ -599,12 +599,12 @@ default value. If not a proc, then it&#39;s some type of constant.</p>
599
599
  <pre class="lines">
600
600
 
601
601
 
602
- 84
603
602
  85
604
- 86</pre>
603
+ 86
604
+ 87</pre>
605
605
  </td>
606
606
  <td>
607
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 84</span>
607
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 85</span>
608
608
 
609
609
  <span class='kw'>def</span> <span class='id identifier rubyid_function'>function</span>
610
610
  <span class='ivar'>@function</span>
@@ -664,12 +664,12 @@ default value. If not a proc, then it&#39;s some type of constant.</p>
664
664
  <pre class="lines">
665
665
 
666
666
 
667
- 71
668
667
  72
669
- 73</pre>
668
+ 73
669
+ 74</pre>
670
670
  </td>
671
671
  <td>
672
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 71</span>
672
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 72</span>
673
673
 
674
674
  <span class='kw'>def</span> <span class='id identifier rubyid_indexed'>indexed</span>
675
675
  <span class='ivar'>@indexed</span>
@@ -729,12 +729,12 @@ default value. If not a proc, then it&#39;s some type of constant.</p>
729
729
  <pre class="lines">
730
730
 
731
731
 
732
- 65
733
732
  66
734
- 67</pre>
733
+ 67
734
+ 68</pre>
735
735
  </td>
736
736
  <td>
737
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 65</span>
737
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 66</span>
738
738
 
739
739
  <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
740
740
  <span class='ivar'>@name</span>
@@ -798,12 +798,12 @@ value that must evaluate to a truthy value.</p>
798
798
  <pre class="lines">
799
799
 
800
800
 
801
- 80
802
801
  81
803
- 82</pre>
802
+ 82
803
+ 83</pre>
804
804
  </td>
805
805
  <td>
806
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 80</span>
806
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 81</span>
807
807
 
808
808
  <span class='kw'>def</span> <span class='id identifier rubyid_set_if'>set_if</span>
809
809
  <span class='ivar'>@set_if</span>
@@ -863,12 +863,12 @@ value that must evaluate to a truthy value.</p>
863
863
  <pre class="lines">
864
864
 
865
865
 
866
- 68
867
866
  69
868
- 70</pre>
867
+ 70
868
+ 71</pre>
869
869
  </td>
870
870
  <td>
871
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 68</span>
871
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 69</span>
872
872
 
873
873
  <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
874
874
  <span class='ivar'>@type</span>
@@ -970,17 +970,17 @@ type, which is looked up in the above table.</p>
970
970
  <pre class="lines">
971
971
 
972
972
 
973
- 50
974
973
  51
975
974
  52
976
975
  53
977
976
  54
978
977
  55
979
978
  56
980
- 57</pre>
979
+ 57
980
+ 58</pre>
981
981
  </td>
982
982
  <td>
983
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 50</span>
983
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 51</span>
984
984
 
985
985
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='label'>name:</span><span class='comma'>,</span> <span class='label'>type:</span><span class='rparen'>)</span>
986
986
  <span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='const'>ENTRY</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span>
@@ -1049,12 +1049,12 @@ type, which is looked up in the above table.</p>
1049
1049
  <pre class="lines">
1050
1050
 
1051
1051
 
1052
- 60
1053
1052
  61
1054
- 62</pre>
1053
+ 62
1054
+ 63</pre>
1055
1055
  </td>
1056
1056
  <td>
1057
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 60</span>
1057
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 61</span>
1058
1058
 
1059
1059
  <span class='kw'>def</span> <span class='id identifier rubyid_ins?'>ins?</span>
1060
1060
  <span class='ivar'>@ins</span>
@@ -1107,17 +1107,17 @@ type, which is looked up in the above table.</p>
1107
1107
  <pre class="lines">
1108
1108
 
1109
1109
 
1110
- 104
1111
1110
  105
1112
1111
  106
1113
1112
  107
1114
1113
  108
1115
1114
  109
1116
1115
  110
1117
- 111</pre>
1116
+ 111
1117
+ 112</pre>
1118
1118
  </td>
1119
1119
  <td>
1120
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 104</span>
1120
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 105</span>
1121
1121
 
1122
1122
  <span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span>
1123
1123
  <span class='lbrace'>{</span>
@@ -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 28 14:41:49 2018 by
1140
+ Generated on Sun Feb 11 10:26:09 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>
@@ -129,7 +129,7 @@
129
129
  </div>
130
130
 
131
131
  <div id="footer">
132
- Generated on Sun Jan 28 14:41:48 2018 by
132
+ Generated on Sun Feb 11 10:26:07 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 28 14:41:48 2018 by
136
+ Generated on Sun Feb 11 10:26:07 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>
@@ -122,7 +122,7 @@ table load time.</p>
122
122
  </div>
123
123
  </dt>
124
124
  <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>
125
- \A(?&lt;type&gt;in/text|in|out/text|out|guard|if|set/nil\?|set/blank\?|set)
125
+ \A(?&lt;type&gt;in/text|in|out/text|out|guard|if|set/nil\?|set/blank\?|set|path)
126
126
  \s*:\s*(?&lt;name&gt;\S?.*)\z
127
127
  </span><span class='regexp_end'>}xi</span></span></pre></dd>
128
128
 
@@ -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 28 14:41:48 2018 by
640
+ Generated on Sun Feb 11 10:26:07 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>
@@ -731,7 +731,7 @@ indexes.</p>
731
731
  </div>
732
732
 
733
733
  <div id="footer">
734
- Generated on Sun Jan 28 14:41:48 2018 by
734
+ Generated on Sun Feb 11 10:26:07 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>
@@ -127,6 +127,28 @@
127
127
 
128
128
 
129
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="#parse_data-class_method" title="parse_data (class method)">.<strong>parse_data</strong>(table:, input:) &#x21d2; Hash{Symbol=&gt;Object} </a>
142
+
143
+
144
+
145
+ </span>
146
+
147
+
148
+
149
+
150
+
151
+
130
152
  <span class="private note title">private</span>
131
153
 
132
154
 
@@ -245,7 +267,8 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
245
267
  17
246
268
  18
247
269
  19
248
- 20</pre>
270
+ 20
271
+ 21</pre>
249
272
  </td>
250
273
  <td>
251
274
  <pre class="code"><span class="info file"># File 'lib/csv_decision/input.rb', line 13</span>
@@ -253,7 +276,8 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
253
276
  <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'>table:</span><span class='comma'>,</span> <span class='label'>input:</span><span class='comma'>,</span> <span class='label'>symbolize_keys:</span><span class='rparen'>)</span>
254
277
  <span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
255
278
 
256
- <span class='id identifier rubyid_parsed_input'>parsed_input</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_input'>parse_input</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_symbolize_keys'>symbolize_keys</span> <span class='op'>?</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_symbolize_keys'>symbolize_keys</span> <span class='op'>:</span> <span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
279
+ <span class='id identifier rubyid_parsed_input'>parsed_input</span> <span class='op'>=</span>
280
+ <span class='id identifier rubyid_parse_data'>parse_data</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_symbolize_keys'>symbolize_keys</span> <span class='op'>?</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_symbolize_keys'>symbolize_keys</span> <span class='op'>:</span> <span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
257
281
 
258
282
  <span class='id identifier rubyid_parsed_input'>parsed_input</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_key'>parse_key</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_parsed_input'>parsed_input</span><span class='lbracket'>[</span><span class='symbol'>:hash</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span>
259
283
  <span class='id identifier rubyid_parsed_input'>parsed_input</span>
@@ -261,6 +285,108 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
261
285
  </td>
262
286
  </tr>
263
287
  </table>
288
+ </div>
289
+
290
+ <div class="method_details ">
291
+ <h3 class="signature " id="parse_data-class_method">
292
+
293
+ .<strong>parse_data</strong>(table:, input:) &#x21d2; <tt>Hash{Symbol=&gt;Object}</tt>
294
+
295
+
296
+
297
+
298
+
299
+ </h3><div class="docstring">
300
+ <div class="discussion">
301
+ <p class="note private">
302
+ <strong>This method is part of a private API.</strong>
303
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
304
+ </p>
305
+
306
+
307
+ </div>
308
+ </div>
309
+ <div class="tags">
310
+ <p class="tag_title">Parameters:</p>
311
+ <ul class="param">
312
+
313
+ <li>
314
+
315
+ <span class='name'>table</span>
316
+
317
+
318
+ <span class='type'>(<tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
319
+
320
+
321
+
322
+ &mdash;
323
+ <div class='inline'>
324
+ <p>Decision table.</p>
325
+ </div>
326
+
327
+ </li>
328
+
329
+ <li>
330
+
331
+ <span class='name'>input</span>
332
+
333
+
334
+ <span class='type'>(<tt>Hash</tt>)</span>
335
+
336
+
337
+
338
+ &mdash;
339
+ <div class='inline'>
340
+ <p>Input hash (keys may or may not be symbolized)</p>
341
+ </div>
342
+
343
+ </li>
344
+
345
+ </ul>
346
+
347
+ <p class="tag_title">Returns:</p>
348
+ <ul class="return">
349
+
350
+ <li>
351
+
352
+
353
+ <span class='type'>(<tt>Hash{Symbol=&gt;Object}</tt>)</span>
354
+
355
+
356
+
357
+ </li>
358
+
359
+ </ul>
360
+
361
+ </div><table class="source_code">
362
+ <tr>
363
+ <td>
364
+ <pre class="lines">
365
+
366
+
367
+ 26
368
+ 27
369
+ 28
370
+ 29
371
+ 30
372
+ 31
373
+ 32
374
+ 33</pre>
375
+ </td>
376
+ <td>
377
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/input.rb', line 26</span>
378
+
379
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_data'>parse_data</span><span class='lparen'>(</span><span class='label'>table:</span><span class='comma'>,</span> <span class='label'>input:</span><span class='rparen'>)</span>
380
+ <span class='id identifier rubyid_defaulted_columns'>defaulted_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_defaults'>defaults</span>
381
+
382
+ <span class='comment'># Code path optimized for no defaults
383
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_parse_cells'>parse_cells</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> <span class='kw'>if</span> <span class='id identifier rubyid_defaulted_columns'>defaulted_columns</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
384
+
385
+ <span class='id identifier rubyid_parse_defaulted'>parse_defaulted</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='comma'>,</span> <span class='label'>defaulted_columns:</span> <span class='id identifier rubyid_defaulted_columns'>defaulted_columns</span><span class='rparen'>)</span>
386
+ <span class='kw'>end</span></pre>
387
+ </td>
388
+ </tr>
389
+ </table>
264
390
  </div>
265
391
 
266
392
  </div>
@@ -268,7 +394,7 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
268
394
  </div>
269
395
 
270
396
  <div id="footer">
271
- Generated on Sun Jan 28 14:41:48 2018 by
397
+ Generated on Sun Feb 11 10:26:07 2018 by
272
398
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
273
399
  0.9.12 (ruby-2.4.0).
274
400
  </div>
@@ -286,7 +286,7 @@
286
286
  </div>
287
287
 
288
288
  <div id="footer">
289
- Generated on Sun Jan 28 14:41:48 2018 by
289
+ Generated on Sun Feb 11 10:26:07 2018 by
290
290
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
291
291
  0.9.12 (ruby-2.4.0).
292
292
  </div>
@@ -94,8 +94,8 @@
94
94
 
95
95
  <dl>
96
96
  <dt>Defined in:</dt>
97
- <dd>lib/csv_decision/matchers.rb<span class="defines">,<br />
98
- lib/csv_decision.rb,<br /> lib/csv_decision/matchers/guard.rb,<br /> lib/csv_decision/matchers/range.rb,<br /> lib/csv_decision/matchers/symbol.rb,<br /> lib/csv_decision/matchers/numeric.rb,<br /> lib/csv_decision/matchers/pattern.rb,<br /> lib/csv_decision/matchers/constant.rb,<br /> lib/csv_decision/matchers/function.rb</span>
97
+ <dd>lib/csv_decision.rb<span class="defines">,<br />
98
+ lib/csv_decision/matchers.rb,<br /> lib/csv_decision/matchers/guard.rb,<br /> lib/csv_decision/matchers/range.rb,<br /> lib/csv_decision/matchers/symbol.rb,<br /> lib/csv_decision/matchers/numeric.rb,<br /> lib/csv_decision/matchers/pattern.rb,<br /> lib/csv_decision/matchers/constant.rb,<br /> lib/csv_decision/matchers/function.rb</span>
99
99
  </dd>
100
100
  </dl>
101
101
 
@@ -178,7 +178,7 @@
178
178
  You should avoid using this constant if possible, as it may be removed or be changed in the future.
179
179
  </p>
180
180
 
181
- <p>Match string for inequality</p>
181
+ <p>Match Regexp for inequality</p>
182
182
 
183
183
 
184
184
  </div>
@@ -219,7 +219,7 @@ with one of these 3 symbols.</p>
219
219
  You should avoid using this constant if possible, as it may be removed or be changed in the future.
220
220
  </p>
221
221
 
222
- <p>Match string for equality</p>
222
+ <p>Match Regexp for equality</p>
223
223
 
224
224
 
225
225
  </div>
@@ -354,6 +354,30 @@ decimal point.</p>
354
354
  <li class="public ">
355
355
  <span class="summary_signature">
356
356
 
357
+ <a href="#compare%3F-class_method" title="compare? (class method)">.<strong>compare?</strong>(lhs:, compare:, rhs:) &#x21d2; nil, Boolean </a>
358
+
359
+
360
+
361
+ </span>
362
+
363
+
364
+
365
+
366
+
367
+
368
+ <span class="private note title">private</span>
369
+
370
+
371
+ <span class="summary_desc"><div class='inline'>
372
+ <p>Compare one object with another if they both respond to the compare method.</p>
373
+ </div></span>
374
+
375
+ </li>
376
+
377
+
378
+ <li class="public ">
379
+ <span class="summary_signature">
380
+
357
381
  <a href="#normalize_operator-class_method" title="normalize_operator (class method)">.<strong>normalize_operator</strong>(operator) &#x21d2; String </a>
358
382
 
359
383
 
@@ -614,14 +638,14 @@ nil.</p>
614
638
  <pre class="lines">
615
639
 
616
640
 
617
- 153
618
- 154
619
- 155
620
- 156
621
- 157</pre>
641
+ 167
642
+ 168
643
+ 169
644
+ 170
645
+ 171</pre>
622
646
  </td>
623
647
  <td>
624
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 153</span>
648
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 167</span>
625
649
 
626
650
  <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>
627
651
  <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>
@@ -688,12 +712,12 @@ nil.</p>
688
712
  <pre class="lines">
689
713
 
690
714
 
691
- 147
692
- 148
693
- 149</pre>
715
+ 161
716
+ 162
717
+ 163</pre>
694
718
  </td>
695
719
  <td>
696
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 147</span>
720
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 161</span>
697
721
 
698
722
  <span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span>
699
723
  <span class='ivar'>@ins</span>
@@ -753,12 +777,12 @@ nil.</p>
753
777
  <pre class="lines">
754
778
 
755
779
 
756
- 150
757
- 151
758
- 152</pre>
780
+ 164
781
+ 165
782
+ 166</pre>
759
783
  </td>
760
784
  <td>
761
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 150</span>
785
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 164</span>
762
786
 
763
787
  <span class='kw'>def</span> <span class='id identifier rubyid_outs'>outs</span>
764
788
  <span class='ivar'>@outs</span>
@@ -776,7 +800,110 @@ nil.</p>
776
800
 
777
801
 
778
802
  <div class="method_details first">
779
- <h3 class="signature first" id="normalize_operator-class_method">
803
+ <h3 class="signature first" id="compare?-class_method">
804
+
805
+ .<strong>compare?</strong>(lhs:, compare:, rhs:) &#x21d2; <tt>nil</tt>, <tt>Boolean</tt>
806
+
807
+
808
+
809
+
810
+
811
+ </h3><div class="docstring">
812
+ <div class="discussion">
813
+ <p class="note private">
814
+ <strong>This method is part of a private API.</strong>
815
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
816
+ </p>
817
+
818
+ <p>Compare one object with another if they both respond to the compare method.</p>
819
+
820
+
821
+ </div>
822
+ </div>
823
+ <div class="tags">
824
+ <p class="tag_title">Parameters:</p>
825
+ <ul class="param">
826
+
827
+ <li>
828
+
829
+ <span class='name'>lhs</span>
830
+
831
+
832
+ <span class='type'>(<tt>Object</tt>)</span>
833
+
834
+
835
+
836
+ </li>
837
+
838
+ <li>
839
+
840
+ <span class='name'>compare</span>
841
+
842
+
843
+ <span class='type'>(<tt>Object</tt>)</span>
844
+
845
+
846
+
847
+ </li>
848
+
849
+ <li>
850
+
851
+ <span class='name'>rhs</span>
852
+
853
+
854
+ <span class='type'>(<tt>Object</tt>)</span>
855
+
856
+
857
+
858
+ </li>
859
+
860
+ </ul>
861
+
862
+ <p class="tag_title">Returns:</p>
863
+ <ul class="return">
864
+
865
+ <li>
866
+
867
+
868
+ <span class='type'>(<tt>nil</tt>, <tt>Boolean</tt>)</span>
869
+
870
+
871
+
872
+ </li>
873
+
874
+ </ul>
875
+
876
+ </div><table class="source_code">
877
+ <tr>
878
+ <td>
879
+ <pre class="lines">
880
+
881
+
882
+ 133
883
+ 134
884
+ 135
885
+ 136
886
+ 137
887
+ 138
888
+ 139</pre>
889
+ </td>
890
+ <td>
891
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 133</span>
892
+
893
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_compare?'>compare?</span><span class='lparen'>(</span><span class='label'>lhs:</span><span class='comma'>,</span> <span class='label'>compare:</span><span class='comma'>,</span> <span class='label'>rhs:</span><span class='rparen'>)</span>
894
+ <span class='comment'># Is the rhs the same class or a superclass of lhs, and does rhs respond to the
895
+ </span> <span class='comment'># compare method?
896
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_lhs'>lhs</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_compare'>compare</span><span class='comma'>,</span> <span class='id identifier rubyid_rhs'>rhs</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_lhs'>lhs</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='id identifier rubyid_rhs'>rhs</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_rhs'>rhs</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_compare'>compare</span><span class='rparen'>)</span>
897
+
898
+ <span class='kw'>nil</span>
899
+ <span class='kw'>end</span></pre>
900
+ </td>
901
+ </tr>
902
+ </table>
903
+ </div>
904
+
905
+ <div class="method_details ">
906
+ <h3 class="signature " id="normalize_operator-class_method">
780
907
 
781
908
  .<strong>normalize_operator</strong>(operator) &#x21d2; <tt>String</tt>
782
909
 
@@ -1024,21 +1151,21 @@ matchers.</p>
1024
1151
  <pre class="lines">
1025
1152
 
1026
1153
 
1027
- 133
1028
- 134
1029
- 135
1030
- 136
1031
- 137
1032
- 138
1033
- 139
1034
- 140
1035
- 141
1036
- 142
1037
- 143
1038
- 144</pre>
1154
+ 147
1155
+ 148
1156
+ 149
1157
+ 150
1158
+ 151
1159
+ 152
1160
+ 153
1161
+ 154
1162
+ 155
1163
+ 156
1164
+ 157
1165
+ 158</pre>
1039
1166
  </td>
1040
1167
  <td>
1041
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 133</span>
1168
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 147</span>
1042
1169
 
1043
1170
  <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>
1044
1171
  <span class='comment'># Build an array of column indexes requiring simple constant matches,
@@ -1311,12 +1438,12 @@ nil.</p>
1311
1438
  <pre class="lines">
1312
1439
 
1313
1440
 
1314
- 164
1315
- 165
1316
- 166</pre>
1441
+ 178
1442
+ 179
1443
+ 180</pre>
1317
1444
  </td>
1318
1445
  <td>
1319
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 164</span>
1446
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 178</span>
1320
1447
 
1321
1448
  <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>
1322
1449
  <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>
@@ -1410,12 +1537,12 @@ nil.</p>
1410
1537
  <pre class="lines">
1411
1538
 
1412
1539
 
1413
- 173
1414
- 174
1415
- 175</pre>
1540
+ 187
1541
+ 188
1542
+ 189</pre>
1416
1543
  </td>
1417
1544
  <td>
1418
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 173</span>
1545
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 187</span>
1419
1546
 
1420
1547
  <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>
1421
1548
  <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>
@@ -1430,7 +1557,7 @@ nil.</p>
1430
1557
  </div>
1431
1558
 
1432
1559
  <div id="footer">
1433
- Generated on Sun Jan 28 14:41:48 2018 by
1560
+ Generated on Sun Feb 11 10:26:07 2018 by
1434
1561
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1435
1562
  0.9.12 (ruby-2.4.0).
1436
1563
  </div>