csv_decision 0.0.6 → 0.0.7

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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -1
  3. data/README.md +112 -93
  4. data/benchmarks/rufus_decision.rb +9 -1
  5. data/csv_decision.gemspec +6 -6
  6. data/doc/CSVDecision.html +54 -90
  7. data/doc/CSVDecision/CellValidationError.html +1 -1
  8. data/doc/CSVDecision/Columns.html +104 -45
  9. data/doc/CSVDecision/Columns/Dictionary.html +40 -24
  10. data/doc/CSVDecision/Columns/Entry.html +209 -22
  11. data/doc/CSVDecision/Constant.html +9 -50
  12. data/doc/CSVDecision/Data.html +182 -47
  13. data/doc/CSVDecision/Decide.html +97 -93
  14. data/doc/CSVDecision/Decision.html +105 -294
  15. data/doc/CSVDecision/Error.html +1 -1
  16. data/doc/CSVDecision/FileError.html +1 -1
  17. data/doc/CSVDecision/Function.html +18 -7
  18. data/doc/CSVDecision/Guard.html +245 -0
  19. data/doc/CSVDecision/Header.html +58 -50
  20. data/doc/CSVDecision/Input.html +20 -12
  21. data/doc/CSVDecision/Load.html +80 -14
  22. data/doc/CSVDecision/Matchers.html +237 -279
  23. data/doc/CSVDecision/Matchers/Constant.html +280 -13
  24. data/doc/CSVDecision/Matchers/Function.html +188 -19
  25. data/doc/CSVDecision/Matchers/Guard.html +568 -0
  26. data/doc/CSVDecision/Matchers/Matcher.html +200 -14
  27. data/doc/CSVDecision/Matchers/Numeric.html +165 -13
  28. data/doc/CSVDecision/Matchers/Pattern.html +56 -163
  29. data/doc/CSVDecision/Matchers/Range.html +48 -37
  30. data/doc/CSVDecision/Matchers/Symbol.html +161 -16
  31. data/doc/CSVDecision/Numeric.html +4 -4
  32. data/doc/CSVDecision/Options.html +53 -55
  33. data/doc/CSVDecision/Parse.html +23 -13
  34. data/doc/CSVDecision/ScanRow.html +461 -73
  35. data/doc/CSVDecision/Symbol.html +4 -4
  36. data/doc/CSVDecision/Table.html +185 -79
  37. data/doc/_index.html +15 -28
  38. data/doc/class_list.html +1 -1
  39. data/doc/file.README.html +105 -82
  40. data/doc/index.html +105 -82
  41. data/doc/method_list.html +137 -113
  42. data/doc/top-level-namespace.html +1 -1
  43. data/lib/csv_decision.rb +2 -5
  44. data/lib/csv_decision/columns.rb +14 -5
  45. data/lib/csv_decision/data.rb +24 -6
  46. data/lib/csv_decision/decide.rb +18 -20
  47. data/lib/csv_decision/decision.rb +106 -42
  48. data/lib/csv_decision/header.rb +44 -23
  49. data/lib/csv_decision/input.rb +4 -2
  50. data/lib/csv_decision/load.rb +7 -3
  51. data/lib/csv_decision/matchers.rb +49 -41
  52. data/lib/csv_decision/matchers/constant.rb +62 -4
  53. data/lib/csv_decision/matchers/function.rb +33 -2
  54. data/lib/csv_decision/matchers/guard.rb +143 -0
  55. data/lib/csv_decision/matchers/numeric.rb +34 -3
  56. data/lib/csv_decision/matchers/pattern.rb +11 -4
  57. data/lib/csv_decision/matchers/range.rb +34 -26
  58. data/lib/csv_decision/matchers/symbol.rb +71 -5
  59. data/lib/csv_decision/options.rb +31 -20
  60. data/lib/csv_decision/parse.rb +28 -9
  61. data/lib/csv_decision/scan_row.rb +79 -13
  62. data/lib/csv_decision/table.rb +34 -23
  63. data/spec/csv_decision/columns_spec.rb +32 -7
  64. data/spec/csv_decision/constant_spec.rb +2 -26
  65. data/spec/csv_decision/decision_spec.rb +0 -9
  66. data/spec/csv_decision/examples_spec.rb +33 -16
  67. data/spec/csv_decision/matchers/function_spec.rb +1 -1
  68. data/spec/csv_decision/matchers/guard_spec.rb +153 -0
  69. data/spec/csv_decision/matchers/numeric_spec.rb +1 -1
  70. data/spec/csv_decision/matchers/pattern_spec.rb +2 -2
  71. data/spec/csv_decision/matchers/range_spec.rb +2 -2
  72. data/spec/csv_decision/matchers/symbol_spec.rb +1 -1
  73. data/spec/csv_decision/options_spec.rb +3 -3
  74. data/spec/csv_decision/table_spec.rb +96 -12
  75. data/spec/data/valid/benchmark_regexp.csv +10 -0
  76. data/spec/data/valid/regular_expressions.csv +11 -0
  77. metadata +14 -9
  78. data/lib/csv_decision/constant.rb +0 -54
  79. data/lib/csv_decision/function.rb +0 -32
  80. data/lib/csv_decision/numeric.rb +0 -38
  81. data/lib/csv_decision/symbol.rb +0 -73
@@ -62,7 +62,7 @@
62
62
  <div id="content"><h1>Class: CSVDecision::Columns::Entry
63
63
 
64
64
 
65
-
65
+ <span class="private note title">Private</span>
66
66
  </h1>
67
67
  <div class="box_info">
68
68
 
@@ -103,7 +103,11 @@
103
103
 
104
104
  <h2>Overview</h2><div class="docstring">
105
105
  <div class="discussion">
106
-
106
+ <p class="note private">
107
+ <strong>This class is part of a private API.</strong>
108
+ You should avoid using this class if possible, as it may be removed or be changed in the future.
109
+ </p>
110
+
107
111
  <p>Value object to hold column dictionary entries.</p>
108
112
 
109
113
 
@@ -119,6 +123,33 @@
119
123
  <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
120
124
  <ul class="summary">
121
125
 
126
+ <li class="public ">
127
+ <span class="summary_signature">
128
+
129
+ <a href="#eval-instance_method" title="#eval (instance method)">#<strong>eval</strong> &#x21d2; Object </a>
130
+
131
+
132
+
133
+ </span>
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'>
147
+ <p>Returns the value of attribute eval.</p>
148
+ </div></span>
149
+
150
+ </li>
151
+
152
+
122
153
  <li class="public ">
123
154
  <span class="summary_signature">
124
155
 
@@ -149,7 +180,7 @@
149
180
  <li class="public ">
150
181
  <span class="summary_signature">
151
182
 
152
- <a href="#text_only-instance_method" title="#text_only (instance method)">#<strong>text_only</strong> &#x21d2; Object </a>
183
+ <a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Object </a>
153
184
 
154
185
 
155
186
 
@@ -167,7 +198,7 @@
167
198
 
168
199
 
169
200
  <span class="summary_desc"><div class='inline'>
170
- <p>Returns the value of attribute text_only.</p>
201
+ <p>Returns the value of attribute type.</p>
171
202
  </div></span>
172
203
 
173
204
  </li>
@@ -178,15 +209,109 @@
178
209
 
179
210
 
180
211
 
212
+
213
+ <h2>
214
+ Instance Method Summary
215
+ <small><a href="#" class="summary_toggle">collapse</a></small>
216
+ </h2>
217
+
218
+ <ul class="summary">
219
+
220
+ <li class="public ">
221
+ <span class="summary_signature">
222
+
223
+ <a href="#ins%3F-instance_method" title="#ins? (instance method)">#<strong>ins?</strong> &#x21d2; Boolean </a>
224
+
225
+
226
+
227
+ </span>
228
+
229
+
230
+
231
+
232
+
233
+
234
+ <span class="private note title">private</span>
235
+
236
+
237
+ <span class="summary_desc"><div class='inline'></div></span>
238
+
239
+ </li>
240
+
241
+
242
+ </ul>
243
+
244
+
181
245
 
182
246
 
183
247
  <div id="instance_attr_details" class="attr_details">
184
248
  <h2>Instance Attribute Details</h2>
185
249
 
186
250
 
187
- <span id="name=-instance_method"></span>
251
+ <span id="eval=-instance_method"></span>
188
252
  <div class="method_details first">
189
- <h3 class="signature first" id="name-instance_method">
253
+ <h3 class="signature first" id="eval-instance_method">
254
+
255
+ #<strong>eval</strong> &#x21d2; <tt>Object</tt>
256
+
257
+
258
+
259
+
260
+
261
+ </h3><div class="docstring">
262
+ <div class="discussion">
263
+
264
+ <p>Returns the value of attribute eval</p>
265
+
266
+
267
+ </div>
268
+ </div>
269
+ <div class="tags">
270
+
271
+ <p class="tag_title">Returns:</p>
272
+ <ul class="return">
273
+
274
+ <li>
275
+
276
+
277
+ <span class='type'>(<tt>Object</tt>)</span>
278
+
279
+
280
+
281
+ &mdash;
282
+ <div class='inline'>
283
+ <p>the current value of eval</p>
284
+ </div>
285
+
286
+ </li>
287
+
288
+ </ul>
289
+
290
+ </div><table class="source_code">
291
+ <tr>
292
+ <td>
293
+ <pre class="lines">
294
+
295
+
296
+ 12
297
+ 13
298
+ 14</pre>
299
+ </td>
300
+ <td>
301
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 12</span>
302
+
303
+ <span class='kw'>def</span> <span class='id identifier rubyid_eval'>eval</span>
304
+ <span class='ivar'>@eval</span>
305
+ <span class='kw'>end</span></pre>
306
+ </td>
307
+ </tr>
308
+ </table>
309
+ </div>
310
+
311
+
312
+ <span id="name=-instance_method"></span>
313
+ <div class="method_details ">
314
+ <h3 class="signature " id="name-instance_method">
190
315
 
191
316
  #<strong>name</strong> &#x21d2; <tt>Object</tt>
192
317
 
@@ -229,12 +354,12 @@
229
354
  <pre class="lines">
230
355
 
231
356
 
232
- 10
233
- 11
234
- 12</pre>
357
+ 12
358
+ 13
359
+ 14</pre>
235
360
  </td>
236
361
  <td>
237
- <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 10</span>
362
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 12</span>
238
363
 
239
364
  <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
240
365
  <span class='ivar'>@name</span>
@@ -245,11 +370,11 @@
245
370
  </div>
246
371
 
247
372
 
248
- <span id="text_only=-instance_method"></span>
373
+ <span id="type=-instance_method"></span>
249
374
  <div class="method_details ">
250
- <h3 class="signature " id="text_only-instance_method">
375
+ <h3 class="signature " id="type-instance_method">
251
376
 
252
- #<strong>text_only</strong> &#x21d2; <tt>Object</tt>
377
+ #<strong>type</strong> &#x21d2; <tt>Object</tt>
253
378
 
254
379
 
255
380
 
@@ -258,7 +383,7 @@
258
383
  </h3><div class="docstring">
259
384
  <div class="discussion">
260
385
 
261
- <p>Returns the value of attribute text_only</p>
386
+ <p>Returns the value of attribute type</p>
262
387
 
263
388
 
264
389
  </div>
@@ -277,7 +402,7 @@
277
402
 
278
403
  &mdash;
279
404
  <div class='inline'>
280
- <p>the current value of text_only</p>
405
+ <p>the current value of type</p>
281
406
  </div>
282
407
 
283
408
  </li>
@@ -290,15 +415,15 @@
290
415
  <pre class="lines">
291
416
 
292
417
 
293
- 10
294
- 11
295
- 12</pre>
418
+ 12
419
+ 13
420
+ 14</pre>
296
421
  </td>
297
422
  <td>
298
- <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 10</span>
423
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 12</span>
299
424
 
300
- <span class='kw'>def</span> <span class='id identifier rubyid_text_only'>text_only</span>
301
- <span class='ivar'>@text_only</span>
425
+ <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
426
+ <span class='ivar'>@type</span>
302
427
  <span class='kw'>end</span></pre>
303
428
  </td>
304
429
  </tr>
@@ -308,10 +433,72 @@
308
433
  </div>
309
434
 
310
435
 
436
+ <div id="instance_method_details" class="method_details_list">
437
+ <h2>Instance Method Details</h2>
438
+
439
+
440
+ <div class="method_details first">
441
+ <h3 class="signature first" id="ins?-instance_method">
442
+
443
+ #<strong>ins?</strong> &#x21d2; <tt>Boolean</tt>
444
+
445
+
446
+
447
+
448
+
449
+ </h3><div class="docstring">
450
+ <div class="discussion">
451
+ <p class="note private">
452
+ <strong>This method is part of a private API.</strong>
453
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
454
+ </p>
455
+
456
+
457
+ </div>
458
+ </div>
459
+ <div class="tags">
460
+
461
+ <p class="tag_title">Returns:</p>
462
+ <ul class="return">
463
+
464
+ <li>
465
+
466
+
467
+ <span class='type'>(<tt>Boolean</tt>)</span>
468
+
469
+
470
+
471
+ </li>
472
+
473
+ </ul>
474
+
475
+ </div><table class="source_code">
476
+ <tr>
477
+ <td>
478
+ <pre class="lines">
479
+
480
+
481
+ 13
482
+ 14
483
+ 15</pre>
484
+ </td>
485
+ <td>
486
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 13</span>
487
+
488
+ <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>
490
+ <span class='kw'>end</span></pre>
491
+ </td>
492
+ </tr>
493
+ </table>
494
+ </div>
495
+
496
+ </div>
497
+
311
498
  </div>
312
499
 
313
500
  <div id="footer">
314
- Generated on Tue Dec 26 21:20:20 2017 by
501
+ Generated on Sat Dec 30 13:04:05 2017 by
315
502
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
316
503
  0.9.12 (ruby-2.3.0).
317
504
  </div>
@@ -86,7 +86,8 @@
86
86
  <h2>Overview</h2><div class="docstring">
87
87
  <div class="discussion">
88
88
 
89
- <p>Recognise constant expressions in table data cells.</p>
89
+ <p>Recognise constant expressions in table data cells - e.g., <tt>= nil</tt>,
90
+ <tt>:=true</tt>.</p>
90
91
 
91
92
 
92
93
  </div>
@@ -95,48 +96,6 @@
95
96
 
96
97
 
97
98
  </div>
98
- <h2>Constant Summary</h2>
99
- <dl class="constants">
100
-
101
- <dt id="EXPRESSION-constant" class="">EXPRESSION =
102
- <div class="docstring">
103
- <div class="discussion">
104
-
105
- <p>Cell constant expression specified by prefixing the value with one of the
106
- three equality symbols.</p>
107
-
108
-
109
- </div>
110
- </div>
111
- <div class="tags">
112
-
113
-
114
- </div>
115
- </dt>
116
- <dd><pre class="code"><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='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>(?&lt;operator&gt;</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers.html#EQUALS-constant" title="CSVDecision::Matchers::EQUALS (constant)">EQUALS</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)\\s*(?&lt;value&gt;\\S.*)</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span></pre></dd>
117
-
118
- <dt id="NON_NUMERIC-constant" class="">NON_NUMERIC =
119
- <div class="docstring">
120
- <div class="discussion">
121
-
122
- <p>Non-numeric constants recognised by CSV Decision.</p>
123
-
124
-
125
- </div>
126
- </div>
127
- <div class="tags">
128
-
129
-
130
- </div>
131
- </dt>
132
- <dd><pre class="code"><span class='lbrace'>{</span>
133
- <span class='label'>nil:</span> <span class='kw'>nil</span><span class='comma'>,</span>
134
- <span class='label'>true:</span> <span class='kw'>true</span><span class='comma'>,</span>
135
- <span class='label'>false:</span> <span class='kw'>false</span>
136
- <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
137
-
138
- </dl>
139
-
140
99
 
141
100
 
142
101
 
@@ -255,20 +214,20 @@ some type of function.</p>
255
214
  <pre class="lines">
256
215
 
257
216
 
258
- 24
259
- 25
260
- 26
261
217
  27
262
218
  28
263
219
  29
264
220
  30
265
- 31</pre>
221
+ 31
222
+ 32
223
+ 33
224
+ 34</pre>
266
225
  </td>
267
226
  <td>
268
- <pre class="code"><span class="info file"># File 'lib/csv_decision/constant.rb', line 24</span>
227
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/constant.rb', line 27</span>
269
228
 
270
229
  <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>
271
- <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='id identifier rubyid_match'>match</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#EXPRESSION-constant" title="CSVDecision::Constant::EXPRESSION (constant)">EXPRESSION</a></span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span><span class='rparen'>)</span>
230
+ <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='id identifier rubyid_match'>match</span> <span class='op'>=</span> <span class='const'>EXPRESSION</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span><span class='rparen'>)</span>
272
231
 
273
232
  <span class='id identifier rubyid_proc'>proc</span> <span class='op'>=</span> <span class='id identifier rubyid_non_numeric?'>non_numeric?</span><span class='lparen'>(</span><span class='id identifier rubyid_match'>match</span><span class='rparen'>)</span>
274
233
  <span class='kw'>return</span> <span class='id identifier rubyid_proc'>proc</span> <span class='kw'>if</span> <span class='id identifier rubyid_proc'>proc</span>
@@ -285,7 +244,7 @@ some type of function.</p>
285
244
  </div>
286
245
 
287
246
  <div id="footer">
288
- Generated on Tue Dec 26 21:20:19 2017 by
247
+ Generated on Fri Dec 29 09:33:35 2017 by
289
248
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
290
249
  0.9.12 (ruby-2.3.0).
291
250
  </div>
@@ -62,7 +62,7 @@
62
62
  <div id="content"><h1>Module: CSVDecision::Data
63
63
 
64
64
 
65
-
65
+ <span class="private note title">Private</span>
66
66
  </h1>
67
67
  <div class="box_info">
68
68
 
@@ -85,8 +85,12 @@
85
85
 
86
86
  <h2>Overview</h2><div class="docstring">
87
87
  <div class="discussion">
88
-
89
- <p>Methods to load data from a file, CSV string or array of arrays</p>
88
+ <p class="note private">
89
+ <strong>This module is part of a private API.</strong>
90
+ You should avoid using this module if possible, as it may be removed or be changed in the future.
91
+ </p>
92
+
93
+ <p>Methods to load data from a file, CSV string or an array of arrays.</p>
90
94
 
91
95
 
92
96
  </div>
@@ -95,16 +99,6 @@
95
99
 
96
100
 
97
101
  </div>
98
- <h2>Constant Summary</h2>
99
- <dl class="constants">
100
-
101
- <dt id="CSV_OPTIONS-constant" class="">CSV_OPTIONS =
102
-
103
- </dt>
104
- <dd><pre class="code"><span class='lbrace'>{</span> <span class='label'>encoding:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>UTF-8</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>skip_blanks:</span> <span class='kw'>true</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
105
-
106
- </dl>
107
-
108
102
 
109
103
 
110
104
 
@@ -122,7 +116,7 @@
122
116
  <li class="public ">
123
117
  <span class="summary_signature">
124
118
 
125
- <a href="#input_file%3F-class_method" title="input_file? (class method)">.<strong>input_file?</strong>(input) &#x21d2; Boolean </a>
119
+ <a href="#input_file%3F-class_method" title="input_file? (class method)">.<strong>input_file?</strong>(data) &#x21d2; Boolean </a>
126
120
 
127
121
 
128
122
 
@@ -133,10 +127,12 @@
133
127
 
134
128
 
135
129
 
136
-
130
+ <span class="private note title">private</span>
137
131
 
138
132
 
139
- <span class="summary_desc"><div class='inline'></div></span>
133
+ <span class="summary_desc"><div class='inline'>
134
+ <p>If the input is a file name return true, otherwise false.</p>
135
+ </div></span>
140
136
 
141
137
  </li>
142
138
 
@@ -144,7 +140,7 @@
144
140
  <li class="public ">
145
141
  <span class="summary_signature">
146
142
 
147
- <a href="#strip_columns-class_method" title="strip_columns (class method)">.<strong>strip_columns</strong>(data:, empty_columns:) &#x21d2; Object </a>
143
+ <a href="#strip_columns-class_method" title="strip_columns (class method)">.<strong>strip_columns</strong>(data:, empty_columns:) &#x21d2; Array&lt;Array&lt;String&gt;&gt; </a>
148
144
 
149
145
 
150
146
 
@@ -155,10 +151,12 @@
155
151
 
156
152
 
157
153
 
158
-
154
+ <span class="private note title">private</span>
159
155
 
160
156
 
161
- <span class="summary_desc"><div class='inline'></div></span>
157
+ <span class="summary_desc"><div class='inline'>
158
+ <p>Strip the empty columns from the input data rows.</p>
159
+ </div></span>
162
160
 
163
161
  </li>
164
162
 
@@ -166,7 +164,7 @@
166
164
  <li class="public ">
167
165
  <span class="summary_signature">
168
166
 
169
- <a href="#to_array-class_method" title="to_array (class method)">.<strong>to_array</strong>(data:) &#x21d2; Object </a>
167
+ <a href="#to_array-class_method" title="to_array (class method)">.<strong>to_array</strong>(data:) &#x21d2; Array&lt;Array&lt;String&gt;&gt; </a>
170
168
 
171
169
 
172
170
 
@@ -177,7 +175,7 @@
177
175
 
178
176
 
179
177
 
180
-
178
+ <span class="private note title">private</span>
181
179
 
182
180
 
183
181
  <span class="summary_desc"><div class='inline'>
@@ -200,7 +198,7 @@ array of arrays.</p>
200
198
  <div class="method_details first">
201
199
  <h3 class="signature first" id="input_file?-class_method">
202
200
 
203
- .<strong>input_file?</strong>(input) &#x21d2; <tt>Boolean</tt>
201
+ .<strong>input_file?</strong>(data) &#x21d2; <tt>Boolean</tt>
204
202
 
205
203
 
206
204
 
@@ -208,12 +206,38 @@ array of arrays.</p>
208
206
 
209
207
  </h3><div class="docstring">
210
208
  <div class="discussion">
211
-
209
+ <p class="note private">
210
+ <strong>This method is part of a private API.</strong>
211
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
212
+ </p>
213
+
214
+ <p>If the input is a file name return true, otherwise false.</p>
215
+
212
216
 
213
217
  </div>
214
218
  </div>
215
219
  <div class="tags">
220
+ <p class="tag_title">Parameters:</p>
221
+ <ul class="param">
222
+
223
+ <li>
224
+
225
+ <span class='name'>data</span>
226
+
227
+
228
+ <span class='type'>(<tt>Pathname</tt>, <tt>File</tt>, <tt>Array&lt;Array&lt;String&gt;&gt;</tt>, <tt>String</tt>)</span>
229
+
230
+
231
+
232
+ &mdash;
233
+ <div class='inline'>
234
+ <p>input data given as a CSV file, array of arrays or CSV string.</p>
235
+ </div>
236
+
237
+ </li>
216
238
 
239
+ </ul>
240
+
217
241
  <p class="tag_title">Returns:</p>
218
242
  <ul class="return">
219
243
 
@@ -224,6 +248,11 @@ array of arrays.</p>
224
248
 
225
249
 
226
250
 
251
+ &mdash;
252
+ <div class='inline'>
253
+ <p>Set to true if the input data is passed as a File or Pathname.</p>
254
+ </div>
255
+
227
256
  </li>
228
257
 
229
258
  </ul>
@@ -234,15 +263,15 @@ array of arrays.</p>
234
263
  <pre class="lines">
235
264
 
236
265
 
237
- 21
238
- 22
239
- 23</pre>
266
+ 34
267
+ 35
268
+ 36</pre>
240
269
  </td>
241
270
  <td>
242
- <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 21</span>
271
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 34</span>
243
272
 
244
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_input_file?'>input_file?</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
245
- <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Pathname</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>File</span><span class='rparen'>)</span>
273
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_input_file?'>input_file?</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
274
+ <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'>Pathname</span><span class='rparen'>)</span> <span class='op'>||</span> <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'>File</span><span class='rparen'>)</span>
246
275
  <span class='kw'>end</span></pre>
247
276
  </td>
248
277
  </tr>
@@ -252,28 +281,92 @@ array of arrays.</p>
252
281
  <div class="method_details ">
253
282
  <h3 class="signature " id="strip_columns-class_method">
254
283
 
255
- .<strong>strip_columns</strong>(data:, empty_columns:) &#x21d2; <tt>Object</tt>
284
+ .<strong>strip_columns</strong>(data:, empty_columns:) &#x21d2; <tt>Array&lt;Array&lt;String&gt;&gt;</tt>
285
+
286
+
287
+
288
+
256
289
 
290
+ </h3><div class="docstring">
291
+ <div class="discussion">
292
+ <p class="note private">
293
+ <strong>This method is part of a private API.</strong>
294
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
295
+ </p>
296
+
297
+ <p>Strip the empty columns from the input data rows.</p>
257
298
 
299
+
300
+ </div>
301
+ </div>
302
+ <div class="tags">
303
+ <p class="tag_title">Parameters:</p>
304
+ <ul class="param">
305
+
306
+ <li>
307
+
308
+ <span class='name'>empty_columns</span>
309
+
310
+
311
+ <span class='type'>(<tt>Array&lt;Index&gt;</tt>)</span>
312
+
313
+
314
+
315
+ </li>
316
+
317
+ <li>
318
+
319
+ <span class='name'>data</span>
320
+
321
+
322
+ <span class='type'>(<tt>Pathname</tt>, <tt>File</tt>, <tt>Array&lt;Array&lt;String&gt;&gt;</tt>, <tt>String</tt>)</span>
323
+
324
+
325
+
326
+ &mdash;
327
+ <div class='inline'>
328
+ <p>input data given as a CSV file, array of arrays or CSV string.</p>
329
+ </div>
330
+
331
+ </li>
258
332
 
333
+ </ul>
259
334
 
335
+ <p class="tag_title">Returns:</p>
336
+ <ul class="return">
337
+
338
+ <li>
339
+
340
+
341
+ <span class='type'>(<tt>Array&lt;Array&lt;String&gt;&gt;</tt>)</span>
342
+
343
+
344
+
345
+ &mdash;
346
+ <div class='inline'>
347
+ <p>Data array stripped of empty columns.</p>
348
+ </div>
349
+
350
+ </li>
260
351
 
261
- </h3><table class="source_code">
352
+ </ul>
353
+
354
+ </div><table class="source_code">
262
355
  <tr>
263
356
  <td>
264
357
  <pre class="lines">
265
358
 
266
359
 
267
- 25
268
- 26
269
- 27
270
- 28
271
- 29
272
- 30
273
- 31</pre>
360
+ 43
361
+ 44
362
+ 45
363
+ 46
364
+ 47
365
+ 48
366
+ 49</pre>
274
367
  </td>
275
368
  <td>
276
- <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 25</span>
369
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 43</span>
277
370
 
278
371
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_strip_columns'>strip_columns</span><span class='lparen'>(</span><span class='label'>data:</span><span class='comma'>,</span> <span class='label'>empty_columns:</span><span class='rparen'>)</span>
279
372
  <span class='comment'># Adjust column indices as we delete columns the rest shift to the left by 1
@@ -290,7 +383,7 @@ array of arrays.</p>
290
383
  <div class="method_details ">
291
384
  <h3 class="signature " id="to_array-class_method">
292
385
 
293
- .<strong>to_array</strong>(data:) &#x21d2; <tt>Object</tt>
386
+ .<strong>to_array</strong>(data:) &#x21d2; <tt>Array&lt;Array&lt;String&gt;&gt;</tt>
294
387
 
295
388
 
296
389
 
@@ -298,15 +391,57 @@ array of arrays.</p>
298
391
 
299
392
  </h3><div class="docstring">
300
393
  <div class="discussion">
301
-
394
+ <p class="note private">
395
+ <strong>This method is part of a private API.</strong>
396
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
397
+ </p>
398
+
302
399
  <p>Parse the input data which may either be a file path name, CSV string or
303
- array of arrays. Strips out empty columns/rows and comment cells</p>
400
+ array of arrays. Strips out empty columns/rows and comment cells.</p>
304
401
 
305
402
 
306
403
  </div>
307
404
  </div>
308
405
  <div class="tags">
406
+ <p class="tag_title">Parameters:</p>
407
+ <ul class="param">
408
+
409
+ <li>
410
+
411
+ <span class='name'>data</span>
412
+
413
+
414
+ <span class='type'>(<tt>Pathname</tt>, <tt>File</tt>, <tt>Array&lt;Array&lt;String&gt;&gt;</tt>, <tt>String</tt>)</span>
415
+
416
+
417
+
418
+ &mdash;
419
+ <div class='inline'>
420
+ <p>input data given as a CSV file, array of arrays or CSV string.</p>
421
+ </div>
422
+
423
+ </li>
424
+
425
+ </ul>
426
+
427
+ <p class="tag_title">Returns:</p>
428
+ <ul class="return">
429
+
430
+ <li>
431
+
432
+
433
+ <span class='type'>(<tt>Array&lt;Array&lt;String&gt;&gt;</tt>)</span>
434
+
435
+
436
+
437
+ &mdash;
438
+ <div class='inline'>
439
+ <p>Data array stripped of empty rows.</p>
440
+ </div>
441
+
442
+ </li>
309
443
 
444
+ </ul>
310
445
 
311
446
  </div><table class="source_code">
312
447
  <tr>
@@ -314,12 +449,12 @@ array of arrays. Strips out empty columns/rows and comment cells</p>
314
449
  <pre class="lines">
315
450
 
316
451
 
317
- 17
318
- 18
319
- 19</pre>
452
+ 26
453
+ 27
454
+ 28</pre>
320
455
  </td>
321
456
  <td>
322
- <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 17</span>
457
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 26</span>
323
458
 
324
459
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_array'>to_array</span><span class='lparen'>(</span><span class='label'>data:</span><span class='rparen'>)</span>
325
460
  <span class='id identifier rubyid_strip_rows'>strip_rows</span><span class='lparen'>(</span><span class='label'>data:</span> <span class='id identifier rubyid_data_array'>data_array</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span><span class='rparen'>)</span>
@@ -334,7 +469,7 @@ array of arrays. Strips out empty columns/rows and comment cells</p>
334
469
  </div>
335
470
 
336
471
  <div id="footer">
337
- Generated on Tue Dec 26 21:20:19 2017 by
472
+ Generated on Sat Dec 30 13:04:04 2017 by
338
473
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
339
474
  0.9.12 (ruby-2.3.0).
340
475
  </div>