csv_decision 0.0.9 → 0.1.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/README.md +1 -1
  4. data/benchmarks/rufus_decision.rb +3 -5
  5. data/csv_decision.gemspec +1 -3
  6. data/doc/CSVDecision/CellValidationError.html +1 -1
  7. data/doc/CSVDecision/Columns/Dictionary.html +112 -18
  8. data/doc/CSVDecision/Columns.html +112 -81
  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/Dictionary/Entry.html +1 -1
  13. data/doc/CSVDecision/Dictionary.html +152 -7
  14. data/doc/CSVDecision/Error.html +1 -1
  15. data/doc/CSVDecision/FileError.html +1 -1
  16. data/doc/CSVDecision/Header.html +1 -1
  17. data/doc/CSVDecision/Input.html +5 -11
  18. data/doc/CSVDecision/Load.html +1 -1
  19. data/doc/CSVDecision/Matchers/Constant.html +1 -1
  20. data/doc/CSVDecision/Matchers/Function.html +1 -1
  21. data/doc/CSVDecision/Matchers/Guard.html +23 -23
  22. data/doc/CSVDecision/Matchers/Matcher.html +13 -13
  23. data/doc/CSVDecision/Matchers/Numeric.html +3 -3
  24. data/doc/CSVDecision/Matchers/Pattern.html +9 -11
  25. data/doc/CSVDecision/Matchers/Proc.html +571 -0
  26. data/doc/CSVDecision/Matchers/Range.html +1 -1
  27. data/doc/CSVDecision/Matchers/Symbol.html +1 -1
  28. data/doc/CSVDecision/Matchers.html +63 -83
  29. data/doc/CSVDecision/Options.html +1 -1
  30. data/doc/CSVDecision/Parse.html +115 -8
  31. data/doc/CSVDecision/Result.html +55 -37
  32. data/doc/CSVDecision/ScanRow.html +3 -3
  33. data/doc/CSVDecision/Table.html +5 -6
  34. data/doc/CSVDecision.html +5 -5
  35. data/doc/_index.html +12 -5
  36. data/doc/class_list.html +1 -1
  37. data/doc/file.README.html +2 -2
  38. data/doc/index.html +2 -2
  39. data/doc/method_list.html +110 -46
  40. data/doc/top-level-namespace.html +1 -1
  41. data/lib/csv_decision/columns.rb +14 -9
  42. data/lib/csv_decision/dictionary.rb +46 -21
  43. data/lib/csv_decision/input.rb +13 -6
  44. data/lib/csv_decision/matchers/constant.rb +1 -1
  45. data/lib/csv_decision/matchers/guard.rb +7 -10
  46. data/lib/csv_decision/matchers/numeric.rb +2 -2
  47. data/lib/csv_decision/matchers/pattern.rb +1 -2
  48. data/lib/csv_decision/matchers/range.rb +1 -1
  49. data/lib/csv_decision/matchers/symbol.rb +1 -1
  50. data/lib/csv_decision/matchers.rb +38 -4
  51. data/lib/csv_decision/parse.rb +100 -5
  52. data/lib/csv_decision/result.rb +23 -7
  53. data/lib/csv_decision/table.rb +2 -2
  54. data/spec/csv_decision/columns_spec.rb +89 -0
  55. data/spec/csv_decision/examples_spec.rb +23 -1
  56. data/spec/csv_decision/input_spec.rb +0 -2
  57. data/spec/csv_decision/table_spec.rb +1 -1
  58. metadata +3 -30
@@ -0,0 +1,571 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: CSVDecision::Matchers::Proc
8
+
9
+ &mdash; Documentation by YARD 0.9.12
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "CSVDecision::Matchers::Proc";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (P)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span>
41
+ &raquo;
42
+ <span class="title">Proc</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: CSVDecision::Matchers::Proc
63
+
64
+
65
+ <span class="private note title">Private</span>
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Array</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Array</li>
78
+
79
+ <li class="next">CSVDecision::Matchers::Proc</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/csv_decision/matchers.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
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
+
111
+ <p>Composite object for a data cell proc. Note that we do not need it to be
112
+ comparable. Implemented as an immutable array of 2 or 3 entries for memory
113
+ compactness and speed.</p>
114
+
115
+
116
+ </div>
117
+ </div>
118
+ <div class="tags">
119
+
120
+
121
+ </div>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <h2>
130
+ Instance Method Summary
131
+ <small><a href="#" class="summary_toggle">collapse</a></small>
132
+ </h2>
133
+
134
+ <ul class="summary">
135
+
136
+ <li class="public ">
137
+ <span class="summary_signature">
138
+
139
+ <a href="#function-instance_method" title="#function (instance method)">#<strong>function</strong> &#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>Either a lambda function, or some kind of constant such as an Integer.</p>
155
+ </div></span>
156
+
157
+ </li>
158
+
159
+
160
+ <li class="public ">
161
+ <span class="summary_signature">
162
+
163
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(type:, function:, symbols: nil) &#x21d2; Proc </a>
164
+
165
+
166
+
167
+ </span>
168
+
169
+
170
+ <span class="note title constructor">constructor</span>
171
+
172
+
173
+
174
+
175
+
176
+ <span class="private note title">private</span>
177
+
178
+
179
+ <span class="summary_desc"><div class='inline'>
180
+ <p>A new instance of Proc.</p>
181
+ </div></span>
182
+
183
+ </li>
184
+
185
+
186
+ <li class="public ">
187
+ <span class="summary_signature">
188
+
189
+ <a href="#symbols-instance_method" title="#symbols (instance method)">#<strong>symbols</strong> &#x21d2; nil, ... </a>
190
+
191
+
192
+
193
+ </span>
194
+
195
+
196
+
197
+
198
+
199
+
200
+ <span class="private note title">private</span>
201
+
202
+
203
+ <span class="summary_desc"><div class='inline'>
204
+ <p>The symbol or list of symbols that the function uses to reference input
205
+ hash keys (which are always symbolized).</p>
206
+ </div></span>
207
+
208
+ </li>
209
+
210
+
211
+ <li class="public ">
212
+ <span class="summary_signature">
213
+
214
+ <a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Symbol </a>
215
+
216
+
217
+
218
+ </span>
219
+
220
+
221
+
222
+
223
+
224
+
225
+ <span class="private note title">private</span>
226
+
227
+
228
+ <span class="summary_desc"><div class='inline'>
229
+ <p>Type of the function value - e.g., :constant or :guard.</p>
230
+ </div></span>
231
+
232
+ </li>
233
+
234
+
235
+ </ul>
236
+
237
+
238
+
239
+ <div id="constructor_details" class="method_details_list">
240
+ <h2>Constructor Details</h2>
241
+
242
+ <div class="method_details first">
243
+ <h3 class="signature first" id="initialize-instance_method">
244
+
245
+ #<strong>initialize</strong>(type:, function:, symbols: nil) &#x21d2; <tt><span class='object_link'><a href="" title="CSVDecision::Matchers::Proc (class)">Proc</a></span></tt>
246
+
247
+
248
+
249
+
250
+
251
+ </h3><div class="docstring">
252
+ <div class="discussion">
253
+ <p class="note private">
254
+ <strong>This method is part of a private API.</strong>
255
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
256
+ </p>
257
+
258
+ <p>Returns a new instance of Proc</p>
259
+
260
+
261
+ </div>
262
+ </div>
263
+ <div class="tags">
264
+ <p class="tag_title">Parameters:</p>
265
+ <ul class="param">
266
+
267
+ <li>
268
+
269
+ <span class='name'>type</span>
270
+
271
+
272
+ <span class='type'>(<tt><span class='object_link'><a href="Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span></tt>)</span>
273
+
274
+
275
+
276
+ &mdash;
277
+ <div class='inline'>
278
+ <p>Type of the function value - e.g., :constant or :guard.</p>
279
+ </div>
280
+
281
+ </li>
282
+
283
+ <li>
284
+
285
+ <span class='name'>function</span>
286
+
287
+
288
+ <span class='type'>(<tt>Object</tt>)</span>
289
+
290
+
291
+
292
+ &mdash;
293
+ <div class='inline'>
294
+ <p>Either a lambda function, or some kind of constant such as an Integer.</p>
295
+ </div>
296
+
297
+ </li>
298
+
299
+ <li>
300
+
301
+ <span class='name'>symbols</span>
302
+
303
+
304
+ <span class='type'>(<tt>nil</tt>, <tt><span class='object_link'><a href="Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span></tt>, <tt>Array&lt;<span class='object_link'><a href="Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span>&gt;</tt>)</span>
305
+
306
+
307
+
308
+ &mdash;
309
+ <div class='inline'>
310
+ <p>The symbol or list of symbols that the function uses to reference input
311
+ hash keys (which are always symbolized).</p>
312
+ </div>
313
+
314
+ </li>
315
+
316
+ </ul>
317
+
318
+
319
+ </div><table class="source_code">
320
+ <tr>
321
+ <td>
322
+ <pre class="lines">
323
+
324
+
325
+ 20
326
+ 21
327
+ 22
328
+ 23
329
+ 24
330
+ 25
331
+ 26
332
+ 27
333
+ 28
334
+ 29
335
+ 30
336
+ 31
337
+ 32</pre>
338
+ </td>
339
+ <td>
340
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 20</span>
341
+
342
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>type:</span><span class='comma'>,</span> <span class='label'>function:</span><span class='comma'>,</span> <span class='label'>symbols:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
343
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
344
+
345
+ <span class='kw'>self</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_type'>type</span>
346
+
347
+ <span class='comment'># Function values should always be frozen
348
+ </span> <span class='kw'>self</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_function'>function</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
349
+
350
+ <span class='comment'># Some function values, such as constants or 0-arity functions, do not reference symbols.
351
+ </span> <span class='kw'>self</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_symbols'>symbols</span> <span class='kw'>if</span> <span class='id identifier rubyid_symbols'>symbols</span>
352
+
353
+ <span class='id identifier rubyid_freeze'>freeze</span>
354
+ <span class='kw'>end</span></pre>
355
+ </td>
356
+ </tr>
357
+ </table>
358
+ </div>
359
+
360
+ </div>
361
+
362
+
363
+ <div id="instance_method_details" class="method_details_list">
364
+ <h2>Instance Method Details</h2>
365
+
366
+
367
+ <div class="method_details first">
368
+ <h3 class="signature first" id="function-instance_method">
369
+
370
+ #<strong>function</strong> &#x21d2; <tt>Object</tt>
371
+
372
+
373
+
374
+
375
+
376
+ </h3><div class="docstring">
377
+ <div class="discussion">
378
+ <p class="note private">
379
+ <strong>This method is part of a private API.</strong>
380
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
381
+ </p>
382
+
383
+ <p>Returns Either a lambda function, or some kind of constant such as an
384
+ Integer.</p>
385
+
386
+
387
+ </div>
388
+ </div>
389
+ <div class="tags">
390
+
391
+ <p class="tag_title">Returns:</p>
392
+ <ul class="return">
393
+
394
+ <li>
395
+
396
+
397
+ <span class='type'>(<tt>Object</tt>)</span>
398
+
399
+
400
+
401
+ &mdash;
402
+ <div class='inline'>
403
+ <p>Either a lambda function, or some kind of constant such as an Integer.</p>
404
+ </div>
405
+
406
+ </li>
407
+
408
+ </ul>
409
+
410
+ </div><table class="source_code">
411
+ <tr>
412
+ <td>
413
+ <pre class="lines">
414
+
415
+
416
+ 40
417
+ 41
418
+ 42</pre>
419
+ </td>
420
+ <td>
421
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 40</span>
422
+
423
+ <span class='kw'>def</span> <span class='id identifier rubyid_function'>function</span>
424
+ <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
425
+ <span class='kw'>end</span></pre>
426
+ </td>
427
+ </tr>
428
+ </table>
429
+ </div>
430
+
431
+ <div class="method_details ">
432
+ <h3 class="signature " id="symbols-instance_method">
433
+
434
+ #<strong>symbols</strong> &#x21d2; <tt>nil</tt>, ...
435
+
436
+
437
+
438
+
439
+
440
+ </h3><div class="docstring">
441
+ <div class="discussion">
442
+ <p class="note private">
443
+ <strong>This method is part of a private API.</strong>
444
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
445
+ </p>
446
+
447
+ <p>Returns The symbol or list of symbols that the function uses to reference
448
+ input hash keys (which are always symbolized).</p>
449
+
450
+
451
+ </div>
452
+ </div>
453
+ <div class="tags">
454
+
455
+ <p class="tag_title">Returns:</p>
456
+ <ul class="return">
457
+
458
+ <li>
459
+
460
+
461
+ <span class='type'>(<tt>nil</tt>, <tt><span class='object_link'><a href="Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span></tt>, <tt>Array&lt;<span class='object_link'><a href="Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span>&gt;</tt>)</span>
462
+
463
+
464
+
465
+ &mdash;
466
+ <div class='inline'>
467
+ <p>The symbol or list of symbols that the function uses to reference input
468
+ hash keys (which are always symbolized).</p>
469
+ </div>
470
+
471
+ </li>
472
+
473
+ </ul>
474
+
475
+ </div><table class="source_code">
476
+ <tr>
477
+ <td>
478
+ <pre class="lines">
479
+
480
+
481
+ 46
482
+ 47
483
+ 48</pre>
484
+ </td>
485
+ <td>
486
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 46</span>
487
+
488
+ <span class='kw'>def</span> <span class='id identifier rubyid_symbols'>symbols</span>
489
+ <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>
490
+ <span class='kw'>end</span></pre>
491
+ </td>
492
+ </tr>
493
+ </table>
494
+ </div>
495
+
496
+ <div class="method_details ">
497
+ <h3 class="signature " id="type-instance_method">
498
+
499
+ #<strong>type</strong> &#x21d2; <tt><span class='object_link'><a href="Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span></tt>
500
+
501
+
502
+
503
+
504
+
505
+ </h3><div class="docstring">
506
+ <div class="discussion">
507
+ <p class="note private">
508
+ <strong>This method is part of a private API.</strong>
509
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
510
+ </p>
511
+
512
+ <p>Returns Type of the function value - e.g., :constant or :guard.</p>
513
+
514
+
515
+ </div>
516
+ </div>
517
+ <div class="tags">
518
+
519
+ <p class="tag_title">Returns:</p>
520
+ <ul class="return">
521
+
522
+ <li>
523
+
524
+
525
+ <span class='type'>(<tt><span class='object_link'><a href="Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span></tt>)</span>
526
+
527
+
528
+
529
+ &mdash;
530
+ <div class='inline'>
531
+ <p>Type of the function value - e.g., :constant or :guard.</p>
532
+ </div>
533
+
534
+ </li>
535
+
536
+ </ul>
537
+
538
+ </div><table class="source_code">
539
+ <tr>
540
+ <td>
541
+ <pre class="lines">
542
+
543
+
544
+ 35
545
+ 36
546
+ 37</pre>
547
+ </td>
548
+ <td>
549
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 35</span>
550
+
551
+ <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
552
+ <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
553
+ <span class='kw'>end</span></pre>
554
+ </td>
555
+ </tr>
556
+ </table>
557
+ </div>
558
+
559
+ </div>
560
+
561
+ </div>
562
+
563
+ <div id="footer">
564
+ Generated on Sat Jan 6 20:03:02 2018 by
565
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
566
+ 0.9.12 (ruby-2.4.0).
567
+ </div>
568
+
569
+ </div>
570
+ </body>
571
+ </html>
@@ -414,7 +414,7 @@ some type of function.</p>
414
414
  </div>
415
415
 
416
416
  <div id="footer">
417
- Generated on Fri Jan 5 21:44:01 2018 by
417
+ Generated on Sat Jan 6 20:03:02 2018 by
418
418
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
419
419
  0.9.12 (ruby-2.4.0).
420
420
  </div>
@@ -415,7 +415,7 @@ some type of function.</p>
415
415
  </div>
416
416
 
417
417
  <div id="footer">
418
- Generated on Fri Jan 5 21:44:01 2018 by
418
+ Generated on Sat Jan 6 20:03:02 2018 by
419
419
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
420
420
  0.9.12 (ruby-2.4.0).
421
421
  </div>