csv_decision 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +26 -2
  4. data/csv_decision.gemspec +1 -1
  5. data/doc/CSVDecision/CellValidationError.html +2 -2
  6. data/doc/CSVDecision/Columns/Default.html +203 -23
  7. data/doc/CSVDecision/Columns/Dictionary.html +118 -25
  8. data/doc/CSVDecision/Columns.html +213 -31
  9. data/doc/CSVDecision/Data.html +1 -1
  10. data/doc/CSVDecision/Decide.html +1 -1
  11. data/doc/CSVDecision/Decision.html +1 -1
  12. data/doc/CSVDecision/Defaults.html +291 -0
  13. data/doc/CSVDecision/Dictionary/Entry.html +584 -47
  14. data/doc/CSVDecision/Dictionary.html +20 -20
  15. data/doc/CSVDecision/Error.html +2 -2
  16. data/doc/CSVDecision/FileError.html +1 -1
  17. data/doc/CSVDecision/Header.html +110 -33
  18. data/doc/CSVDecision/Input.html +1 -1
  19. data/doc/CSVDecision/Load.html +1 -1
  20. data/doc/CSVDecision/Matchers/Constant.html +12 -37
  21. data/doc/CSVDecision/Matchers/Function.html +1 -1
  22. data/doc/CSVDecision/Matchers/Guard.html +15 -13
  23. data/doc/CSVDecision/Matchers/Matcher.html +1 -1
  24. data/doc/CSVDecision/Matchers/Numeric.html +13 -21
  25. data/doc/CSVDecision/Matchers/Pattern.html +14 -14
  26. data/doc/CSVDecision/Matchers/Proc.html +1 -1
  27. data/doc/CSVDecision/Matchers/Range.html +13 -58
  28. data/doc/CSVDecision/Matchers/Symbol.html +1 -1
  29. data/doc/CSVDecision/Matchers.html +9 -9
  30. data/doc/CSVDecision/Options.html +1 -1
  31. data/doc/CSVDecision/Parse.html +90 -19
  32. data/doc/CSVDecision/Result.html +1 -1
  33. data/doc/CSVDecision/ScanRow.html +17 -17
  34. data/doc/CSVDecision/Table.html +50 -48
  35. data/doc/CSVDecision/TableValidationError.html +143 -0
  36. data/doc/CSVDecision/Validate.html +422 -0
  37. data/doc/CSVDecision.html +8 -8
  38. data/doc/_index.html +33 -1
  39. data/doc/class_list.html +1 -1
  40. data/doc/file.README.html +27 -3
  41. data/doc/index.html +27 -3
  42. data/doc/method_list.html +193 -89
  43. data/doc/top-level-namespace.html +1 -1
  44. data/lib/csv_decision/columns.rb +28 -27
  45. data/lib/csv_decision/defaults.rb +47 -0
  46. data/lib/csv_decision/dictionary.rb +104 -112
  47. data/lib/csv_decision/header.rb +13 -10
  48. data/lib/csv_decision/input.rb +53 -5
  49. data/lib/csv_decision/matchers/constant.rb +1 -2
  50. data/lib/csv_decision/matchers/guard.rb +3 -2
  51. data/lib/csv_decision/matchers/numeric.rb +4 -6
  52. data/lib/csv_decision/matchers/pattern.rb +6 -8
  53. data/lib/csv_decision/matchers/range.rb +1 -3
  54. data/lib/csv_decision/matchers.rb +7 -7
  55. data/lib/csv_decision/parse.rb +24 -3
  56. data/lib/csv_decision/scan_row.rb +16 -16
  57. data/lib/csv_decision/table.rb +3 -7
  58. data/lib/csv_decision/validate.rb +85 -0
  59. data/lib/csv_decision.rb +3 -1
  60. data/spec/csv_decision/columns_spec.rb +38 -22
  61. data/spec/csv_decision/examples_spec.rb +17 -0
  62. data/spec/csv_decision/matchers/range_spec.rb +0 -32
  63. data/spec/csv_decision/table_spec.rb +39 -0
  64. metadata +7 -2
@@ -69,13 +69,11 @@
69
69
  <dl>
70
70
  <dt>Inherits:</dt>
71
71
  <dd>
72
- <span class="inheritName">Struct</span>
72
+ <span class="inheritName">Object</span>
73
73
 
74
74
  <ul class="fullTree">
75
75
  <li>Object</li>
76
76
 
77
- <li class="next">Struct</li>
78
-
79
77
  <li class="next">CSVDecision::Dictionary::Entry</li>
80
78
 
81
79
  </ul>
@@ -108,7 +106,7 @@
108
106
  You should avoid using this class if possible, as it may be removed or be changed in the future.
109
107
  </p>
110
108
 
111
- <p>Value object to hold column dictionary entries.</p>
109
+ <p>Column dictionary entries.</p>
112
110
 
113
111
 
114
112
  </div>
@@ -126,7 +124,7 @@
126
124
  <li class="public ">
127
125
  <span class="summary_signature">
128
126
 
129
- <a href="#eval-instance_method" title="#eval (instance method)">#<strong>eval</strong> &#x21d2; Object </a>
127
+ <a href="#eval-instance_method" title="#eval (instance method)">#<strong>eval</strong> &#x21d2; nil, Boolean </a>
130
128
 
131
129
 
132
130
 
@@ -140,11 +138,12 @@
140
138
 
141
139
 
142
140
 
143
-
141
+ <span class="private note title">private</span>
144
142
 
145
143
 
146
144
  <span class="summary_desc"><div class='inline'>
147
- <p>Returns the value of attribute eval.</p>
145
+ <p>If set to true then this column has procs that need evaluating, otherwise
146
+ it only contains constants.</p>
148
147
  </div></span>
149
148
 
150
149
  </li>
@@ -153,7 +152,7 @@
153
152
  <li class="public ">
154
153
  <span class="summary_signature">
155
154
 
156
- <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Object </a>
155
+ <a href="#function-instance_method" title="#function (instance method)">#<strong>function</strong> &#x21d2; Matchers::Proc, Object </a>
157
156
 
158
157
 
159
158
 
@@ -167,11 +166,41 @@
167
166
 
168
167
 
169
168
 
169
+ <span class="private note title">private</span>
170
+
171
+
172
+ <span class="summary_desc"><div class='inline'>
173
+ <p>For a column of type set: gives the proc that must be evaluated to set the
174
+ default value.</p>
175
+ </div></span>
176
+
177
+ </li>
178
+
179
+
180
+ <li class="public ">
181
+ <span class="summary_signature">
182
+
183
+ <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Symbol </a>
184
+
185
+
186
+
187
+ </span>
188
+
189
+
190
+
191
+
192
+ <span class="note title readonly">readonly</span>
193
+
194
+
195
+
196
+
197
+
170
198
 
199
+ <span class="private note title">private</span>
171
200
 
172
201
 
173
202
  <span class="summary_desc"><div class='inline'>
174
- <p>Returns the value of attribute name.</p>
203
+ <p>Column name.</p>
175
204
  </div></span>
176
205
 
177
206
  </li>
@@ -180,7 +209,7 @@
180
209
  <li class="public ">
181
210
  <span class="summary_signature">
182
211
 
183
- <a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Object </a>
212
+ <a href="#set_if-instance_method" title="#set_if (instance method)">#<strong>set_if</strong> &#x21d2; nil, ... </a>
184
213
 
185
214
 
186
215
 
@@ -189,16 +218,47 @@
189
218
 
190
219
 
191
220
 
221
+ <span class="note title readonly">readonly</span>
222
+
192
223
 
193
224
 
194
225
 
195
226
 
196
227
 
228
+ <span class="private note title">private</span>
229
+
230
+
231
+ <span class="summary_desc"><div class='inline'>
232
+ <p>Defined for columns of type :set, nil otherwise.</p>
233
+ </div></span>
197
234
 
235
+ </li>
236
+
237
+
238
+ <li class="public ">
239
+ <span class="summary_signature">
240
+
241
+ <a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Symbol </a>
242
+
243
+
244
+
245
+ </span>
246
+
247
+
248
+
249
+
250
+ <span class="note title readonly">readonly</span>
251
+
252
+
253
+
254
+
255
+
256
+
257
+ <span class="private note title">private</span>
198
258
 
199
259
 
200
260
  <span class="summary_desc"><div class='inline'>
201
- <p>Returns the value of attribute type.</p>
261
+ <p>Column type.</p>
202
262
  </div></span>
203
263
 
204
264
  </li>
@@ -210,6 +270,40 @@
210
270
 
211
271
 
212
272
 
273
+ <h2>
274
+ Class Method Summary
275
+ <small><a href="#" class="summary_toggle">collapse</a></small>
276
+ </h2>
277
+
278
+ <ul class="summary">
279
+
280
+ <li class="public ">
281
+ <span class="summary_signature">
282
+
283
+ <a href="#create-class_method" title="create (class method)">.<strong>create</strong>(name:, type:) &#x21d2; Entry </a>
284
+
285
+
286
+
287
+ </span>
288
+
289
+
290
+
291
+
292
+
293
+
294
+ <span class="private note title">private</span>
295
+
296
+
297
+ <span class="summary_desc"><div class='inline'>
298
+ <p>Create a new column dictionary entry defaulting attributes from the column
299
+ type, which is looked up in <code>ENTRY</code> table.</p>
300
+ </div></span>
301
+
302
+ </li>
303
+
304
+
305
+ </ul>
306
+
213
307
  <h2>
214
308
  Instance Method Summary
215
309
  <small><a href="#" class="summary_toggle">collapse</a></small>
@@ -220,6 +314,32 @@
220
314
  <li class="public ">
221
315
  <span class="summary_signature">
222
316
 
317
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name:, type:, eval: nil, set_if: nil) &#x21d2; Entry </a>
318
+
319
+
320
+
321
+ </span>
322
+
323
+
324
+ <span class="note title constructor">constructor</span>
325
+
326
+
327
+
328
+
329
+
330
+ <span class="private note title">private</span>
331
+
332
+
333
+ <span class="summary_desc"><div class='inline'>
334
+ <p>A new instance of Entry.</p>
335
+ </div></span>
336
+
337
+ </li>
338
+
339
+
340
+ <li class="public ">
341
+ <span class="summary_signature">
342
+
223
343
  <a href="#ins%3F-instance_method" title="#ins? (instance method)">#<strong>ins?</strong> &#x21d2; Boolean </a>
224
344
 
225
345
 
@@ -234,7 +354,33 @@
234
354
  <span class="private note title">private</span>
235
355
 
236
356
 
237
- <span class="summary_desc"><div class='inline'></div></span>
357
+ <span class="summary_desc"><div class='inline'>
358
+ <p>Return true is this is an input column, false otherwise.</p>
359
+ </div></span>
360
+
361
+ </li>
362
+
363
+
364
+ <li class="public ">
365
+ <span class="summary_signature">
366
+
367
+ <a href="#to_h-instance_method" title="#to_h (instance method)">#<strong>to_h</strong> &#x21d2; Hash{Symbol=&gt;[nil, Boolean, Symbol]} </a>
368
+
369
+
370
+
371
+ </span>
372
+
373
+
374
+
375
+
376
+
377
+
378
+ <span class="private note title">private</span>
379
+
380
+
381
+ <span class="summary_desc"><div class='inline'>
382
+ <p>Convert the object&#39;s attributes to a hash.</p>
383
+ </div></span>
238
384
 
239
385
  </li>
240
386
 
@@ -242,8 +388,66 @@
242
388
  </ul>
243
389
 
244
390
 
391
+ <div id="constructor_details" class="method_details_list">
392
+ <h2>Constructor Details</h2>
393
+
394
+ <div class="method_details first">
395
+ <h3 class="signature first" id="initialize-instance_method">
396
+
397
+ #<strong>initialize</strong>(name:, type:, eval: nil, set_if: nil) &#x21d2; <tt><span class='object_link'><a href="" title="CSVDecision::Dictionary::Entry (class)">Entry</a></span></tt>
398
+
399
+
400
+
245
401
 
246
402
 
403
+ </h3><div class="docstring">
404
+ <div class="discussion">
405
+ <p class="note private">
406
+ <strong>This method is part of a private API.</strong>
407
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
408
+ </p>
409
+
410
+ <p>Returns a new instance of Entry</p>
411
+
412
+
413
+ </div>
414
+ </div>
415
+ <div class="tags">
416
+
417
+
418
+ </div><table class="source_code">
419
+ <tr>
420
+ <td>
421
+ <pre class="lines">
422
+
423
+
424
+ 70
425
+ 71
426
+ 72
427
+ 73
428
+ 74
429
+ 75
430
+ 76
431
+ 77</pre>
432
+ </td>
433
+ <td>
434
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 70</span>
435
+
436
+ <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='rparen'>)</span>
437
+ <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
438
+ <span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_type'>type</span>
439
+ <span class='ivar'>@eval</span> <span class='op'>=</span> <span class='id identifier rubyid_eval'>eval</span>
440
+ <span class='ivar'>@set_if</span> <span class='op'>=</span> <span class='id identifier rubyid_set_if'>set_if</span>
441
+ <span class='ivar'>@function</span> <span class='op'>=</span> <span class='kw'>nil</span>
442
+ <span class='ivar'>@ins</span> <span class='op'>=</span> <span class='const'>INS_TYPES</span><span class='period'>.</span><span class='id identifier rubyid_member?'>member?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
443
+ <span class='kw'>end</span></pre>
444
+ </td>
445
+ </tr>
446
+ </table>
447
+ </div>
448
+
449
+ </div>
450
+
247
451
  <div id="instance_attr_details" class="attr_details">
248
452
  <h2>Instance Attribute Details</h2>
249
453
 
@@ -252,7 +456,7 @@
252
456
  <div class="method_details first">
253
457
  <h3 class="signature first" id="eval-instance_method">
254
458
 
255
- #<strong>eval</strong> &#x21d2; <tt>Object</tt>
459
+ #<strong>eval</strong> &#x21d2; <tt>nil</tt>, <tt>Boolean</tt>
256
460
 
257
461
 
258
462
 
@@ -260,8 +464,13 @@
260
464
 
261
465
  </h3><div class="docstring">
262
466
  <div class="discussion">
263
-
264
- <p>Returns the value of attribute eval</p>
467
+ <p class="note private">
468
+ <strong>This method is part of a private API.</strong>
469
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
470
+ </p>
471
+
472
+ <p>Returns If set to true then this column has procs that need evaluating,
473
+ otherwise it only contains constants.</p>
265
474
 
266
475
 
267
476
  </div>
@@ -274,13 +483,14 @@
274
483
  <li>
275
484
 
276
485
 
277
- <span class='type'>(<tt>Object</tt>)</span>
486
+ <span class='type'>(<tt>nil</tt>, <tt>Boolean</tt>)</span>
278
487
 
279
488
 
280
489
 
281
490
  &mdash;
282
491
  <div class='inline'>
283
- <p>the current value of eval</p>
492
+ <p>If set to true then this column has procs that need evaluating, otherwise
493
+ it only contains constants.</p>
284
494
  </div>
285
495
 
286
496
  </li>
@@ -293,12 +503,12 @@
293
503
  <pre class="lines">
294
504
 
295
505
 
296
- 23
297
- 24
298
- 25</pre>
506
+ 55
507
+ 56
508
+ 57</pre>
299
509
  </td>
300
510
  <td>
301
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 23</span>
511
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 55</span>
302
512
 
303
513
  <span class='kw'>def</span> <span class='id identifier rubyid_eval'>eval</span>
304
514
  <span class='ivar'>@eval</span>
@@ -309,11 +519,11 @@
309
519
  </div>
310
520
 
311
521
 
312
- <span id="name=-instance_method"></span>
522
+ <span id="function=-instance_method"></span>
313
523
  <div class="method_details ">
314
- <h3 class="signature " id="name-instance_method">
524
+ <h3 class="signature " id="function-instance_method">
315
525
 
316
- #<strong>name</strong> &#x21d2; <tt>Object</tt>
526
+ #<strong>function</strong> &#x21d2; <tt><span class='object_link'><a href="../Matchers/Proc.html" title="CSVDecision::Matchers::Proc (class)">Matchers::Proc</a></span></tt>, <tt>Object</tt>
317
527
 
318
528
 
319
529
 
@@ -321,8 +531,79 @@
321
531
 
322
532
  </h3><div class="docstring">
323
533
  <div class="discussion">
534
+ <p class="note private">
535
+ <strong>This method is part of a private API.</strong>
536
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
537
+ </p>
538
+
539
+ <p>Returns For a column of type set: gives the proc that must be evaluated to
540
+ set the default value. If not a proc, then it&#39;s some type of constant.</p>
541
+
542
+
543
+ </div>
544
+ </div>
545
+ <div class="tags">
546
+
547
+ <p class="tag_title">Returns:</p>
548
+ <ul class="return">
549
+
550
+ <li>
551
+
552
+
553
+ <span class='type'>(<tt><span class='object_link'><a href="../Matchers/Proc.html" title="CSVDecision::Matchers::Proc (class)">Matchers::Proc</a></span></tt>, <tt>Object</tt>)</span>
554
+
555
+
556
+
557
+ &mdash;
558
+ <div class='inline'>
559
+ <p>For a column of type set: gives the proc that must be evaluated to set the
560
+ default value. If not a proc, then it&#39;s some type of constant.</p>
561
+ </div>
562
+
563
+ </li>
564
+
565
+ </ul>
566
+
567
+ </div><table class="source_code">
568
+ <tr>
569
+ <td>
570
+ <pre class="lines">
571
+
572
+
573
+ 64
574
+ 65
575
+ 66</pre>
576
+ </td>
577
+ <td>
578
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 64</span>
579
+
580
+ <span class='kw'>def</span> <span class='id identifier rubyid_function'>function</span>
581
+ <span class='ivar'>@function</span>
582
+ <span class='kw'>end</span></pre>
583
+ </td>
584
+ </tr>
585
+ </table>
586
+ </div>
324
587
 
325
- <p>Returns the value of attribute name</p>
588
+
589
+ <span id=""></span>
590
+ <div class="method_details ">
591
+ <h3 class="signature " id="name-instance_method">
592
+
593
+ #<strong>name</strong> &#x21d2; <tt>Symbol</tt> <span class="extras">(readonly)</span>
594
+
595
+
596
+
597
+
598
+
599
+ </h3><div class="docstring">
600
+ <div class="discussion">
601
+ <p class="note private">
602
+ <strong>This method is part of a private API.</strong>
603
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
604
+ </p>
605
+
606
+ <p>Returns Column name.</p>
326
607
 
327
608
 
328
609
  </div>
@@ -335,13 +616,13 @@
335
616
  <li>
336
617
 
337
618
 
338
- <span class='type'>(<tt>Object</tt>)</span>
619
+ <span class='type'>(<tt>Symbol</tt>)</span>
339
620
 
340
621
 
341
622
 
342
623
  &mdash;
343
624
  <div class='inline'>
344
- <p>the current value of name</p>
625
+ <p>Column name.</p>
345
626
  </div>
346
627
 
347
628
  </li>
@@ -354,12 +635,12 @@
354
635
  <pre class="lines">
355
636
 
356
637
 
357
- 23
358
- 24
359
- 25</pre>
638
+ 48
639
+ 49
640
+ 50</pre>
360
641
  </td>
361
642
  <td>
362
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 23</span>
643
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 48</span>
363
644
 
364
645
  <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
365
646
  <span class='ivar'>@name</span>
@@ -370,11 +651,11 @@
370
651
  </div>
371
652
 
372
653
 
373
- <span id="type=-instance_method"></span>
654
+ <span id=""></span>
374
655
  <div class="method_details ">
375
- <h3 class="signature " id="type-instance_method">
656
+ <h3 class="signature " id="set_if-instance_method">
376
657
 
377
- #<strong>type</strong> &#x21d2; <tt>Object</tt>
658
+ #<strong>set_if</strong> &#x21d2; <tt>nil</tt>, ... <span class="extras">(readonly)</span>
378
659
 
379
660
 
380
661
 
@@ -382,8 +663,81 @@
382
663
 
383
664
  </h3><div class="docstring">
384
665
  <div class="discussion">
666
+ <p class="note private">
667
+ <strong>This method is part of a private API.</strong>
668
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
669
+ </p>
670
+
671
+ <p>Returns Defined for columns of type :set, nil otherwise. If true, then
672
+ default is set unconditionally, otherwise the method symbol sent to the
673
+ input hash value that must evaluate to a truthy value.</p>
674
+
675
+
676
+ </div>
677
+ </div>
678
+ <div class="tags">
679
+
680
+ <p class="tag_title">Returns:</p>
681
+ <ul class="return">
682
+
683
+ <li>
684
+
685
+
686
+ <span class='type'>(<tt>nil</tt>, <tt>true</tt>, <tt>Symbol</tt>)</span>
687
+
688
+
689
+
690
+ &mdash;
691
+ <div class='inline'>
692
+ <p>Defined for columns of type :set, nil otherwise. If true, then default is
693
+ set unconditionally, otherwise the method symbol sent to the input hash
694
+ value that must evaluate to a truthy value.</p>
695
+ </div>
696
+
697
+ </li>
698
+
699
+ </ul>
700
+
701
+ </div><table class="source_code">
702
+ <tr>
703
+ <td>
704
+ <pre class="lines">
705
+
706
+
707
+ 60
708
+ 61
709
+ 62</pre>
710
+ </td>
711
+ <td>
712
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 60</span>
713
+
714
+ <span class='kw'>def</span> <span class='id identifier rubyid_set_if'>set_if</span>
715
+ <span class='ivar'>@set_if</span>
716
+ <span class='kw'>end</span></pre>
717
+ </td>
718
+ </tr>
719
+ </table>
720
+ </div>
385
721
 
386
- <p>Returns the value of attribute type</p>
722
+
723
+ <span id=""></span>
724
+ <div class="method_details ">
725
+ <h3 class="signature " id="type-instance_method">
726
+
727
+ #<strong>type</strong> &#x21d2; <tt>Symbol</tt> <span class="extras">(readonly)</span>
728
+
729
+
730
+
731
+
732
+
733
+ </h3><div class="docstring">
734
+ <div class="discussion">
735
+ <p class="note private">
736
+ <strong>This method is part of a private API.</strong>
737
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
738
+ </p>
739
+
740
+ <p>Returns Column type.</p>
387
741
 
388
742
 
389
743
  </div>
@@ -396,13 +750,13 @@
396
750
  <li>
397
751
 
398
752
 
399
- <span class='type'>(<tt>Object</tt>)</span>
753
+ <span class='type'>(<tt>Symbol</tt>)</span>
400
754
 
401
755
 
402
756
 
403
757
  &mdash;
404
758
  <div class='inline'>
405
- <p>the current value of type</p>
759
+ <p>Column type.</p>
406
760
  </div>
407
761
 
408
762
  </li>
@@ -415,12 +769,12 @@
415
769
  <pre class="lines">
416
770
 
417
771
 
418
- 23
419
- 24
420
- 25</pre>
772
+ 51
773
+ 52
774
+ 53</pre>
421
775
  </td>
422
776
  <td>
423
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 23</span>
777
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 51</span>
424
778
 
425
779
  <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
426
780
  <span class='ivar'>@type</span>
@@ -433,6 +787,114 @@
433
787
  </div>
434
788
 
435
789
 
790
+ <div id="class_method_details" class="method_details_list">
791
+ <h2>Class Method Details</h2>
792
+
793
+
794
+ <div class="method_details first">
795
+ <h3 class="signature first" id="create-class_method">
796
+
797
+ .<strong>create</strong>(name:, type:) &#x21d2; <tt><span class='object_link'><a href="" title="CSVDecision::Dictionary::Entry (class)">Entry</a></span></tt>
798
+
799
+
800
+
801
+
802
+
803
+ </h3><div class="docstring">
804
+ <div class="discussion">
805
+ <p class="note private">
806
+ <strong>This method is part of a private API.</strong>
807
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
808
+ </p>
809
+
810
+ <p>Create a new column dictionary entry defaulting attributes from the column
811
+ type, which is looked up in <code>ENTRY</code> table.</p>
812
+
813
+
814
+ </div>
815
+ </div>
816
+ <div class="tags">
817
+ <p class="tag_title">Parameters:</p>
818
+ <ul class="param">
819
+
820
+ <li>
821
+
822
+ <span class='name'>name</span>
823
+
824
+
825
+ <span class='type'>(<tt>Symbol</tt>)</span>
826
+
827
+
828
+
829
+ &mdash;
830
+ <div class='inline'>
831
+ <p>Column name.</p>
832
+ </div>
833
+
834
+ </li>
835
+
836
+ <li>
837
+
838
+ <span class='name'>type</span>
839
+
840
+
841
+ <span class='type'>(<tt>Symbol</tt>)</span>
842
+
843
+
844
+
845
+ &mdash;
846
+ <div class='inline'>
847
+ <p>Column type.</p>
848
+ </div>
849
+
850
+ </li>
851
+
852
+ </ul>
853
+
854
+ <p class="tag_title">Returns:</p>
855
+ <ul class="return">
856
+
857
+ <li>
858
+
859
+
860
+ <span class='type'>(<tt><span class='object_link'><a href="" title="CSVDecision::Dictionary::Entry (class)">Entry</a></span></tt>)</span>
861
+
862
+
863
+
864
+ &mdash;
865
+ <div class='inline'>
866
+ <p>Column dictionary entry.</p>
867
+ </div>
868
+
869
+ </li>
870
+
871
+ </ul>
872
+
873
+ </div><table class="source_code">
874
+ <tr>
875
+ <td>
876
+ <pre class="lines">
877
+
878
+
879
+ 37
880
+ 38
881
+ 39
882
+ 40</pre>
883
+ </td>
884
+ <td>
885
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 37</span>
886
+
887
+ <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>
888
+ <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>
889
+ <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>eval:</span> <span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:eval</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>set_if:</span> <span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:set_if</span><span class='rbracket'>]</span><span class='rparen'>)</span>
890
+ <span class='kw'>end</span></pre>
891
+ </td>
892
+ </tr>
893
+ </table>
894
+ </div>
895
+
896
+ </div>
897
+
436
898
  <div id="instance_method_details" class="method_details_list">
437
899
  <h2>Instance Method Details</h2>
438
900
 
@@ -453,6 +915,8 @@
453
915
  You should avoid using this method if possible, as it may be removed or be changed in the future.
454
916
  </p>
455
917
 
918
+ <p>Return true is this is an input column, false otherwise.</p>
919
+
456
920
 
457
921
  </div>
458
922
  </div>
@@ -468,6 +932,11 @@
468
932
 
469
933
 
470
934
 
935
+ &mdash;
936
+ <div class='inline'>
937
+ <p>Return true is this is an input column, false otherwise.</p>
938
+ </div>
939
+
471
940
  </li>
472
941
 
473
942
  </ul>
@@ -478,15 +947,83 @@
478
947
  <pre class="lines">
479
948
 
480
949
 
481
- 24
482
- 25
483
- 26</pre>
950
+ 43
951
+ 44
952
+ 45</pre>
484
953
  </td>
485
954
  <td>
486
- <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 24</span>
955
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 43</span>
487
956
 
488
957
  <span class='kw'>def</span> <span class='id identifier rubyid_ins?'>ins?</span>
489
- <span class='qsymbols_beg'>%i[</span><span class='tstring_content'>in</span><span class='words_sep'> </span><span class='tstring_content'>guard</span><span class='words_sep'>]</span><span class='period'>.</span><span class='id identifier rubyid_member?'>member?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
958
+ <span class='ivar'>@ins</span>
959
+ <span class='kw'>end</span></pre>
960
+ </td>
961
+ </tr>
962
+ </table>
963
+ </div>
964
+
965
+ <div class="method_details ">
966
+ <h3 class="signature " id="to_h-instance_method">
967
+
968
+ #<strong>to_h</strong> &#x21d2; <tt>Hash{Symbol=&gt;[nil, Boolean, Symbol]}</tt>
969
+
970
+
971
+
972
+
973
+
974
+ </h3><div class="docstring">
975
+ <div class="discussion">
976
+ <p class="note private">
977
+ <strong>This method is part of a private API.</strong>
978
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
979
+ </p>
980
+
981
+ <p>Convert the object&#39;s attributes to a hash.</p>
982
+
983
+
984
+ </div>
985
+ </div>
986
+ <div class="tags">
987
+
988
+ <p class="tag_title">Returns:</p>
989
+ <ul class="return">
990
+
991
+ <li>
992
+
993
+
994
+ <span class='type'>(<tt>Hash{Symbol=&gt;[nil, Boolean, Symbol]}</tt>)</span>
995
+
996
+
997
+
998
+ </li>
999
+
1000
+ </ul>
1001
+
1002
+ </div><table class="source_code">
1003
+ <tr>
1004
+ <td>
1005
+ <pre class="lines">
1006
+
1007
+
1008
+ 82
1009
+ 83
1010
+ 84
1011
+ 85
1012
+ 86
1013
+ 87
1014
+ 88
1015
+ 89</pre>
1016
+ </td>
1017
+ <td>
1018
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/dictionary.rb', line 82</span>
1019
+
1020
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span>
1021
+ <span class='lbrace'>{</span>
1022
+ <span class='label'>name:</span> <span class='ivar'>@name</span><span class='comma'>,</span>
1023
+ <span class='label'>type:</span> <span class='ivar'>@type</span><span class='comma'>,</span>
1024
+ <span class='label'>eval:</span> <span class='ivar'>@eval</span><span class='comma'>,</span>
1025
+ <span class='label'>set_if:</span> <span class='ivar'>@set_if</span>
1026
+ <span class='rbrace'>}</span>
490
1027
  <span class='kw'>end</span></pre>
491
1028
  </td>
492
1029
  </tr>
@@ -498,7 +1035,7 @@
498
1035
  </div>
499
1036
 
500
1037
  <div id="footer">
501
- Generated on Sat Jan 6 20:03:02 2018 by
1038
+ Generated on Sat Jan 13 10:02:47 2018 by
502
1039
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
503
1040
  0.9.12 (ruby-2.4.0).
504
1041
  </div>