csv_decision 0.2.0 → 0.3.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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -1
  3. data/README.md +11 -8
  4. data/benchmarks/rufus_decision.rb +9 -1
  5. data/csv_decision.gemspec +1 -1
  6. data/doc/CSVDecision/CellValidationError.html +1 -1
  7. data/doc/CSVDecision/Columns/Dictionary.html +29 -29
  8. data/doc/CSVDecision/Columns.html +394 -47
  9. data/doc/CSVDecision/Data.html +2 -2
  10. data/doc/CSVDecision/Decide.html +23 -159
  11. data/doc/CSVDecision/Decision.html +370 -32
  12. data/doc/CSVDecision/Defaults.html +1 -1
  13. data/doc/CSVDecision/Dictionary/Entry.html +157 -55
  14. data/doc/CSVDecision/Dictionary.html +37 -21
  15. data/doc/CSVDecision/Error.html +1 -1
  16. data/doc/CSVDecision/FileError.html +1 -1
  17. data/doc/CSVDecision/Header.html +142 -1
  18. data/doc/CSVDecision/Index.html +741 -0
  19. data/doc/CSVDecision/Input.html +14 -61
  20. data/doc/CSVDecision/Load.html +1 -1
  21. data/doc/CSVDecision/Matchers/Constant.html +1 -1
  22. data/doc/CSVDecision/Matchers/Function.html +1 -1
  23. data/doc/CSVDecision/Matchers/Guard.html +13 -147
  24. data/doc/CSVDecision/Matchers/Matcher.html +13 -13
  25. data/doc/CSVDecision/Matchers/Numeric.html +1 -1
  26. data/doc/CSVDecision/Matchers/Pattern.html +1 -1
  27. data/doc/CSVDecision/Matchers/Proc.html +147 -14
  28. data/doc/CSVDecision/Matchers/Range.html +1 -1
  29. data/doc/CSVDecision/Matchers/Symbol.html +1 -1
  30. data/doc/CSVDecision/Matchers.html +55 -162
  31. data/doc/CSVDecision/Options.html +21 -21
  32. data/doc/CSVDecision/Parse.html +2 -180
  33. data/doc/CSVDecision/Result.html +220 -38
  34. data/doc/CSVDecision/ScanRow.html +69 -325
  35. data/doc/CSVDecision/Table.html +128 -40
  36. data/doc/CSVDecision/TableValidationError.html +1 -1
  37. data/doc/CSVDecision/Validate.html +1 -1
  38. data/doc/CSVDecision.html +4 -4
  39. data/doc/_index.html +8 -8
  40. data/doc/class_list.html +1 -1
  41. data/doc/file.README.html +13 -11
  42. data/doc/index.html +13 -11
  43. data/doc/method_list.html +206 -150
  44. data/doc/top-level-namespace.html +1 -1
  45. data/lib/csv_decision/columns.rb +87 -1
  46. data/lib/csv_decision/decision.rb +54 -29
  47. data/lib/csv_decision/defaults.rb +1 -1
  48. data/lib/csv_decision/dictionary.rb +32 -22
  49. data/lib/csv_decision/header.rb +17 -0
  50. data/lib/csv_decision/index.rb +107 -0
  51. data/lib/csv_decision/input.rb +45 -13
  52. data/lib/csv_decision/matchers/guard.rb +2 -0
  53. data/lib/csv_decision/matchers.rb +14 -8
  54. data/lib/csv_decision/options.rb +7 -19
  55. data/lib/csv_decision/parse.rb +12 -96
  56. data/lib/csv_decision/result.rb +10 -9
  57. data/lib/csv_decision/scan_row.rb +20 -44
  58. data/lib/csv_decision/table.rb +7 -4
  59. data/lib/csv_decision.rb +1 -1
  60. data/spec/csv_decision/columns_spec.rb +6 -6
  61. data/spec/csv_decision/data_spec.rb +0 -5
  62. data/spec/csv_decision/index_spec.rb +58 -0
  63. data/spec/csv_decision/input_spec.rb +7 -2
  64. data/spec/csv_decision/options_spec.rb +16 -1
  65. data/spec/csv_decision/parse_spec.rb +4 -5
  66. data/spec/csv_decision/table_spec.rb +70 -0
  67. data/spec/data/{valid → invalid}/empty.csv +0 -0
  68. data/spec/data/valid/index_example.csv +12 -0
  69. data/spec/data/valid/multi_column_index.csv +10 -0
  70. data/spec/data/valid/multi_column_index2.csv +12 -0
  71. data/spec/data/valid/options_in_file3.csv +13 -0
  72. metadata +16 -5
  73. data/lib/csv_decision/decide.rb +0 -45
@@ -176,60 +176,7 @@ column. Defaults to nil if the key is missing in the input hash.</p>
176
176
  </div>
177
177
  </div>
178
178
  <div class="tags">
179
- <p class="tag_title">Parameters:</p>
180
- <ul class="param">
181
179
 
182
- <li>
183
-
184
- <span class='name'>table</span>
185
-
186
-
187
- <span class='type'>(<tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
188
-
189
-
190
-
191
- &mdash;
192
- <div class='inline'>
193
- <p>Decision table.</p>
194
- </div>
195
-
196
- </li>
197
-
198
- <li>
199
-
200
- <span class='name'>input</span>
201
-
202
-
203
- <span class='type'>(<tt>Hash</tt>)</span>
204
-
205
-
206
-
207
- &mdash;
208
- <div class='inline'>
209
- <p>Input hash (keys may or may not be symbolized)</p>
210
- </div>
211
-
212
- </li>
213
-
214
- <li>
215
-
216
- <span class='name'>symbolize_keys</span>
217
-
218
-
219
- <span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
220
-
221
-
222
-
223
- &mdash;
224
- <div class='inline'>
225
- <p>Set to false if keys are symbolized and it&#39;s OK to mutate the input
226
- hash. Otherwise a copy of the input hash is symbolized.</p>
227
- </div>
228
-
229
- </li>
230
-
231
- </ul>
232
-
233
180
  <p class="tag_title">Returns:</p>
234
181
  <ul class="return">
235
182
 
@@ -271,7 +218,10 @@ column. Defaults to nil if the key is missing in the input hash.</p>
271
218
  24
272
219
  25
273
220
  26
274
- 27</pre>
221
+ 27
222
+ 28
223
+ 29
224
+ 30</pre>
275
225
  </td>
276
226
  <td>
277
227
  <pre class="code"><span class="info file"># File 'lib/csv_decision/input.rb', line 17</span>
@@ -279,13 +229,16 @@ column. Defaults to nil if the key is missing in the input hash.</p>
279
229
  <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>
280
230
  <span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
281
231
 
282
- <span class='id identifier rubyid_parsed_input'>parsed_input</span> <span class='op'>=</span>
283
- <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_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_input'>input</span><span class='comma'>,</span> <span class='id identifier rubyid_symbolize_keys'>symbolize_keys</span><span class='rparen'>)</span><span class='rparen'>)</span>
284
-
285
- <span class='comment'># We can freeze it as we made our own copy
286
- </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='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span> <span class='kw'>if</span> <span class='id identifier rubyid_symbolize_keys'>symbolize_keys</span>
232
+ <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_scan_cols'>scan_cols</span> <span class='op'>=</span>
233
+ <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>
287
234
 
288
- <span class='id identifier rubyid_parsed_input'>parsed_input</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
235
+ <span class='lbrace'>{</span>
236
+ <span class='comment'># We can freeze the input hash for safety if we made our own copy.
237
+ </span> <span class='label'>hash:</span> <span class='id identifier rubyid_symbolize_keys'>symbolize_keys</span> <span class='op'>?</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span> <span class='op'>:</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span>
238
+ <span class='label'>scan_cols:</span> <span class='id identifier rubyid_scan_cols'>scan_cols</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span>
239
+ <span class='comment'># Build the index key if this table is indexed.
240
+ </span> <span class='label'>key:</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='op'>?</span> <span class='id identifier rubyid_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_hash'>hash</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
241
+ <span class='rbrace'>}</span>
289
242
  <span class='kw'>end</span></pre>
290
243
  </td>
291
244
  </tr>
@@ -297,7 +250,7 @@ column. Defaults to nil if the key is missing in the input hash.</p>
297
250
  </div>
298
251
 
299
252
  <div id="footer">
300
- Generated on Sat Jan 13 10:02:46 2018 by
253
+ Generated on Sat Jan 20 15:44:34 2018 by
301
254
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
302
255
  0.9.12 (ruby-2.4.0).
303
256
  </div>
@@ -281,7 +281,7 @@
281
281
  </div>
282
282
 
283
283
  <div id="footer">
284
- Generated on Sat Jan 13 10:02:46 2018 by
284
+ Generated on Sat Jan 20 15:44:34 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>
@@ -474,7 +474,7 @@ some type of function.</p>
474
474
  </div>
475
475
 
476
476
  <div id="footer">
477
- Generated on Sat Jan 13 10:02:47 2018 by
477
+ Generated on Sat Jan 20 15:44:36 2018 by
478
478
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
479
479
  0.9.12 (ruby-2.4.0).
480
480
  </div>
@@ -501,7 +501,7 @@ some type of function.</p>
501
501
  </div>
502
502
 
503
503
  <div id="footer">
504
- Generated on Sat Jan 13 10:02:47 2018 by
504
+ Generated on Sat Jan 20 15:44:36 2018 by
505
505
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
506
506
  0.9.12 (ruby-2.4.0).
507
507
  </div>
@@ -153,50 +153,6 @@
153
153
  <p>Determine if the input cell string is recognised by this Matcher.</p>
154
154
  </div></span>
155
155
 
156
- </li>
157
-
158
-
159
- <li class="public ">
160
- <span class="summary_signature">
161
-
162
- <a href="#regexp_match-class_method" title="regexp_match (class method)">.<strong>regexp_match</strong>(symbol, value, hash) &#x21d2; Object </a>
163
-
164
-
165
-
166
- </span>
167
-
168
-
169
-
170
-
171
-
172
-
173
- <span class="private note title">private</span>
174
-
175
-
176
- <span class="summary_desc"><div class='inline'></div></span>
177
-
178
- </li>
179
-
180
-
181
- <li class="public ">
182
- <span class="summary_signature">
183
-
184
- <a href="#symbol_function-class_method" title="symbol_function (class method)">.<strong>symbol_function</strong>(symbol, method, hash) &#x21d2; Object </a>
185
-
186
-
187
-
188
- </span>
189
-
190
-
191
-
192
-
193
-
194
-
195
- <span class="private note title">private</span>
196
-
197
-
198
- <span class="summary_desc"><div class='inline'></div></span>
199
-
200
156
  </li>
201
157
 
202
158
 
@@ -355,15 +311,15 @@ some type of function.</p>
355
311
  <pre class="lines">
356
312
 
357
313
 
358
- 130
359
- 131
360
314
  132
361
315
  133
362
316
  134
363
- 135</pre>
317
+ 135
318
+ 136
319
+ 137</pre>
364
320
  </td>
365
321
  <td>
366
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers/guard.rb', line 130</span>
322
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers/guard.rb', line 132</span>
367
323
 
368
324
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_matches?'>matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span>
369
325
  <span class='id identifier rubyid_proc'>proc</span> <span class='op'>=</span> <span class='id identifier rubyid_symbol_proc'>symbol_proc</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span>
@@ -374,96 +330,6 @@ some type of function.</p>
374
330
  </td>
375
331
  </tr>
376
332
  </table>
377
- </div>
378
-
379
- <div class="method_details ">
380
- <h3 class="signature " id="regexp_match-class_method">
381
-
382
- .<strong>regexp_match</strong>(symbol, value, hash) &#x21d2; <tt>Object</tt>
383
-
384
-
385
-
386
-
387
-
388
- </h3><div class="docstring">
389
- <div class="discussion">
390
- <p class="note private">
391
- <strong>This method is part of a private API.</strong>
392
- You should avoid using this method if possible, as it may be removed or be changed in the future.
393
- </p>
394
-
395
-
396
- </div>
397
- </div>
398
- <div class="tags">
399
-
400
-
401
- </div><table class="source_code">
402
- <tr>
403
- <td>
404
- <pre class="lines">
405
-
406
-
407
- 50
408
- 51
409
- 52
410
- 53
411
- 54</pre>
412
- </td>
413
- <td>
414
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers/guard.rb', line 50</span>
415
-
416
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_regexp_match'>regexp_match</span><span class='lparen'>(</span><span class='id identifier rubyid_symbol'>symbol</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
417
- <span class='kw'>return</span> <span class='kw'>false</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>
418
- <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_symbol'>symbol</span><span class='rbracket'>]</span>
419
- <span class='id identifier rubyid_data'>data</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> <span class='op'>&amp;&amp;</span> <span class='const'><span class='object_link'><a href="../Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_regexp'><span class='object_link'><a href="../Matchers.html#regexp-class_method" title="CSVDecision::Matchers.regexp (method)">regexp</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
420
- <span class='kw'>end</span></pre>
421
- </td>
422
- </tr>
423
- </table>
424
- </div>
425
-
426
- <div class="method_details ">
427
- <h3 class="signature " id="symbol_function-class_method">
428
-
429
- .<strong>symbol_function</strong>(symbol, method, hash) &#x21d2; <tt>Object</tt>
430
-
431
-
432
-
433
-
434
-
435
- </h3><div class="docstring">
436
- <div class="discussion">
437
- <p class="note private">
438
- <strong>This method is part of a private API.</strong>
439
- You should avoid using this method if possible, as it may be removed or be changed in the future.
440
- </p>
441
-
442
-
443
- </div>
444
- </div>
445
- <div class="tags">
446
-
447
-
448
- </div><table class="source_code">
449
- <tr>
450
- <td>
451
- <pre class="lines">
452
-
453
-
454
- 46
455
- 47
456
- 48</pre>
457
- </td>
458
- <td>
459
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers/guard.rb', line 46</span>
460
-
461
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_symbol_function'>symbol_function</span><span class='lparen'>(</span><span class='id identifier rubyid_symbol'>symbol</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
462
- <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_symbol'>symbol</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_symbol'>symbol</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
463
- <span class='kw'>end</span></pre>
464
- </td>
465
- </tr>
466
- </table>
467
333
  </div>
468
334
 
469
335
  </div>
@@ -544,12 +410,12 @@ some type of function.</p>
544
410
  <pre class="lines">
545
411
 
546
412
 
547
- 139
548
- 140
549
- 141</pre>
413
+ 141
414
+ 142
415
+ 143</pre>
550
416
  </td>
551
417
  <td>
552
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers/guard.rb', line 139</span>
418
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers/guard.rb', line 141</span>
553
419
 
554
420
  <span class='kw'>def</span> <span class='id identifier rubyid_matches?'>matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span>
555
421
  <span class='const'><span class='object_link'><a href="" title="CSVDecision::Matchers::Guard (class)">Guard</a></span></span><span class='period'>.</span><span class='id identifier rubyid_matches?'><span class='object_link'><a href="#matches%3F-class_method" title="CSVDecision::Matchers::Guard.matches? (method)">matches?</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span>
@@ -607,12 +473,12 @@ some type of function.</p>
607
473
  <pre class="lines">
608
474
 
609
475
 
610
- 144
611
- 145
612
- 146</pre>
476
+ 146
477
+ 147
478
+ 148</pre>
613
479
  </td>
614
480
  <td>
615
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers/guard.rb', line 144</span>
481
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers/guard.rb', line 146</span>
616
482
 
617
483
  <span class='kw'>def</span> <span class='id identifier rubyid_outs?'>outs?</span>
618
484
  <span class='kw'>true</span>
@@ -627,7 +493,7 @@ some type of function.</p>
627
493
  </div>
628
494
 
629
495
  <div id="footer">
630
- Generated on Sat Jan 13 10:02:47 2018 by
496
+ Generated on Sat Jan 20 15:44:36 2018 by
631
497
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
632
498
  0.9.12 (ruby-2.4.0).
633
499
  </div>
@@ -267,10 +267,10 @@
267
267
  <pre class="lines">
268
268
 
269
269
 
270
- 163</pre>
270
+ 169</pre>
271
271
  </td>
272
272
  <td>
273
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 163</span>
273
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 169</span>
274
274
 
275
275
  <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='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
276
276
  </td>
@@ -333,12 +333,12 @@
333
333
  <pre class="lines">
334
334
 
335
335
 
336
- 185
337
- 186
338
- 187</pre>
336
+ 191
337
+ 192
338
+ 193</pre>
339
339
  </td>
340
340
  <td>
341
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 185</span>
341
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 191</span>
342
342
 
343
343
  <span class='kw'>def</span> <span class='id identifier rubyid_ins?'>ins?</span>
344
344
  <span class='kw'>true</span>
@@ -418,10 +418,10 @@ some type of function.</p>
418
418
  <pre class="lines">
419
419
 
420
420
 
421
- 171</pre>
421
+ 177</pre>
422
422
  </td>
423
423
  <td>
424
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 171</span>
424
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 177</span>
425
425
 
426
426
  <span class='kw'>def</span> <span class='id identifier rubyid_matches?'>matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
427
427
  </td>
@@ -477,12 +477,12 @@ some type of function.</p>
477
477
  <pre class="lines">
478
478
 
479
479
 
480
- 177
481
- 178
482
- 179</pre>
480
+ 183
481
+ 184
482
+ 185</pre>
483
483
  </td>
484
484
  <td>
485
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 177</span>
485
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 183</span>
486
486
 
487
487
  <span class='kw'>def</span> <span class='id identifier rubyid_outs?'>outs?</span>
488
488
  <span class='kw'>false</span>
@@ -497,7 +497,7 @@ some type of function.</p>
497
497
  </div>
498
498
 
499
499
  <div id="footer">
500
- Generated on Sat Jan 13 10:02:47 2018 by
500
+ Generated on Sat Jan 20 15:44:35 2018 by
501
501
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
502
502
  0.9.12 (ruby-2.4.0).
503
503
  </div>
@@ -411,7 +411,7 @@ some type of function.</p>
411
411
  </div>
412
412
 
413
413
  <div id="footer">
414
- Generated on Sat Jan 13 10:02:47 2018 by
414
+ Generated on Sat Jan 20 15:44:36 2018 by
415
415
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
416
416
  0.9.12 (ruby-2.4.0).
417
417
  </div>
@@ -481,7 +481,7 @@ some type of function.</p>
481
481
  </div>
482
482
 
483
483
  <div id="footer">
484
- Generated on Sat Jan 13 10:02:47 2018 by
484
+ Generated on Sat Jan 20 15:44:36 2018 by
485
485
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
486
486
  0.9.12 (ruby-2.4.0).
487
487
  </div>
@@ -136,6 +136,30 @@ compactness and speed.</p>
136
136
  <li class="public ">
137
137
  <span class="summary_signature">
138
138
 
139
+ <a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong>(hash:, value: nil) &#x21d2; Object </a>
140
+
141
+
142
+
143
+ </span>
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <span class="private note title">private</span>
151
+
152
+
153
+ <span class="summary_desc"><div class='inline'>
154
+ <p>Value returned from function call.</p>
155
+ </div></span>
156
+
157
+ </li>
158
+
159
+
160
+ <li class="public ">
161
+ <span class="summary_signature">
162
+
139
163
  <a href="#function-instance_method" title="#function (instance method)">#<strong>function</strong> &#x21d2; Object </a>
140
164
 
141
165
 
@@ -365,7 +389,116 @@ hash keys (which are always symbolized).</p>
365
389
 
366
390
 
367
391
  <div class="method_details first">
368
- <h3 class="signature first" id="function-instance_method">
392
+ <h3 class="signature first" id="call-instance_method">
393
+
394
+ #<strong>call</strong>(hash:, value: nil) &#x21d2; <tt>Object</tt>
395
+
396
+
397
+
398
+
399
+
400
+ </h3><div class="docstring">
401
+ <div class="discussion">
402
+ <p class="note private">
403
+ <strong>This method is part of a private API.</strong>
404
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
405
+ </p>
406
+
407
+ <p>Returns Value returned from function call.</p>
408
+
409
+
410
+ </div>
411
+ </div>
412
+ <div class="tags">
413
+ <p class="tag_title">Parameters:</p>
414
+ <ul class="param">
415
+
416
+ <li>
417
+
418
+ <span class='name'>hash</span>
419
+
420
+
421
+ <span class='type'>(<tt>Hash</tt>)</span>
422
+
423
+
424
+
425
+ &mdash;
426
+ <div class='inline'>
427
+ <p>Input hash to function call.</p>
428
+ </div>
429
+
430
+ </li>
431
+
432
+ <li>
433
+
434
+ <span class='name'>value</span>
435
+
436
+
437
+ <span class='type'>(<tt>Object</tt>)</span>
438
+
439
+
440
+
441
+ &mdash;
442
+ <div class='inline'>
443
+ <p>Input value to function call.</p>
444
+ </div>
445
+
446
+ </li>
447
+
448
+ </ul>
449
+
450
+ <p class="tag_title">Returns:</p>
451
+ <ul class="return">
452
+
453
+ <li>
454
+
455
+
456
+ <span class='type'>(<tt>Object</tt>)</span>
457
+
458
+
459
+
460
+ &mdash;
461
+ <div class='inline'>
462
+ <p>Value returned from function call.</p>
463
+ </div>
464
+
465
+ </li>
466
+
467
+ </ul>
468
+
469
+ </div><table class="source_code">
470
+ <tr>
471
+ <td>
472
+ <pre class="lines">
473
+
474
+
475
+ 37
476
+ 38
477
+ 39
478
+ 40
479
+ 41
480
+ 42
481
+ 43
482
+ 44</pre>
483
+ </td>
484
+ <td>
485
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 37</span>
486
+
487
+ <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='label'>hash:</span><span class='comma'>,</span> <span class='label'>value:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
488
+ <span class='id identifier rubyid_func'>func</span> <span class='op'>=</span> <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
489
+
490
+ <span class='kw'>return</span> <span class='id identifier rubyid_func'>func</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='symbol'>:guard</span>
491
+
492
+ <span class='comment'># All other procs can take one or two args
493
+ </span> <span class='id identifier rubyid_func'>func</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span> <span class='op'>==</span> <span class='int'>1</span> <span class='op'>?</span> <span class='id identifier rubyid_func'>func</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_func'>func</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
494
+ <span class='kw'>end</span></pre>
495
+ </td>
496
+ </tr>
497
+ </table>
498
+ </div>
499
+
500
+ <div class="method_details ">
501
+ <h3 class="signature " id="function-instance_method">
369
502
 
370
503
  #<strong>function</strong> &#x21d2; <tt>Object</tt>
371
504
 
@@ -413,12 +546,12 @@ Integer.</p>
413
546
  <pre class="lines">
414
547
 
415
548
 
416
- 40
417
- 41
418
- 42</pre>
549
+ 52
550
+ 53
551
+ 54</pre>
419
552
  </td>
420
553
  <td>
421
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 40</span>
554
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 52</span>
422
555
 
423
556
  <span class='kw'>def</span> <span class='id identifier rubyid_function'>function</span>
424
557
  <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
@@ -478,12 +611,12 @@ hash keys (which are always symbolized).</p>
478
611
  <pre class="lines">
479
612
 
480
613
 
481
- 46
482
- 47
483
- 48</pre>
614
+ 58
615
+ 59
616
+ 60</pre>
484
617
  </td>
485
618
  <td>
486
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 46</span>
619
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 58</span>
487
620
 
488
621
  <span class='kw'>def</span> <span class='id identifier rubyid_symbols'>symbols</span>
489
622
  <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
@@ -541,12 +674,12 @@ hash keys (which are always symbolized).</p>
541
674
  <pre class="lines">
542
675
 
543
676
 
544
- 35
545
- 36
546
- 37</pre>
677
+ 47
678
+ 48
679
+ 49</pre>
547
680
  </td>
548
681
  <td>
549
- <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 35</span>
682
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 47</span>
550
683
 
551
684
  <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
552
685
  <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
@@ -561,7 +694,7 @@ hash keys (which are always symbolized).</p>
561
694
  </div>
562
695
 
563
696
  <div id="footer">
564
- Generated on Sat Jan 13 10:02:47 2018 by
697
+ Generated on Sat Jan 20 15:44:35 2018 by
565
698
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
566
699
  0.9.12 (ruby-2.4.0).
567
700
  </div>