csv_decision 0.0.3 → 0.0.4

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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +2 -0
  3. data/.gitignore +2 -1
  4. data/.travis.yml +2 -3
  5. data/CHANGELOG.md +19 -1
  6. data/README.md +49 -16
  7. data/{benchmark.rb → benchmarks/rufus_decision.rb} +1 -1
  8. data/csv_decision.gemspec +1 -1
  9. data/doc/CSVDecision/CellValidationError.html +143 -0
  10. data/doc/CSVDecision/Columns/Default.html +409 -0
  11. data/doc/CSVDecision/Columns/Dictionary.html +410 -0
  12. data/doc/CSVDecision/Columns/Entry.html +321 -0
  13. data/doc/CSVDecision/Columns.html +476 -0
  14. data/doc/CSVDecision/Constant.html +295 -0
  15. data/doc/CSVDecision/Data.html +344 -0
  16. data/doc/CSVDecision/Decide.html +434 -0
  17. data/doc/CSVDecision/Decision.html +604 -0
  18. data/doc/CSVDecision/Error.html +139 -0
  19. data/doc/CSVDecision/FileError.html +143 -0
  20. data/doc/CSVDecision/Function.html +229 -0
  21. data/doc/CSVDecision/Header.html +520 -0
  22. data/doc/CSVDecision/Input.html +305 -0
  23. data/doc/CSVDecision/Load.html +225 -0
  24. data/doc/CSVDecision/Matchers/Constant.html +242 -0
  25. data/doc/CSVDecision/Matchers/Function.html +342 -0
  26. data/doc/CSVDecision/Matchers/Matcher.html +325 -0
  27. data/doc/CSVDecision/Matchers/Numeric.html +277 -0
  28. data/doc/CSVDecision/Matchers/Pattern.html +600 -0
  29. data/doc/CSVDecision/Matchers/Range.html +413 -0
  30. data/doc/CSVDecision/Matchers/Symbol.html +280 -0
  31. data/doc/CSVDecision/Matchers.html +1529 -0
  32. data/doc/CSVDecision/Numeric.html +259 -0
  33. data/doc/CSVDecision/Options.html +445 -0
  34. data/doc/CSVDecision/Parse.html +270 -0
  35. data/doc/CSVDecision/ScanRow.html +746 -0
  36. data/doc/CSVDecision/Symbol.html +256 -0
  37. data/doc/CSVDecision/Table.html +1115 -0
  38. data/doc/CSVDecision.html +652 -0
  39. data/doc/_index.html +410 -0
  40. data/doc/class_list.html +51 -0
  41. data/doc/css/common.css +1 -0
  42. data/doc/css/full_list.css +58 -0
  43. data/doc/css/style.css +499 -0
  44. data/doc/file.README.html +264 -0
  45. data/doc/file_list.html +56 -0
  46. data/doc/frames.html +17 -0
  47. data/doc/index.html +264 -0
  48. data/doc/js/app.js +248 -0
  49. data/doc/js/full_list.js +216 -0
  50. data/doc/js/jquery.js +4 -0
  51. data/doc/method_list.html +683 -0
  52. data/doc/top-level-namespace.html +110 -0
  53. data/lib/csv_decision/columns.rb +15 -12
  54. data/lib/csv_decision/constant.rb +54 -0
  55. data/lib/csv_decision/decide.rb +5 -5
  56. data/lib/csv_decision/decision.rb +3 -1
  57. data/lib/csv_decision/function.rb +32 -0
  58. data/lib/csv_decision/header.rb +27 -18
  59. data/lib/csv_decision/input.rb +11 -8
  60. data/lib/csv_decision/matchers/constant.rb +18 -0
  61. data/lib/csv_decision/matchers/function.rb +11 -44
  62. data/lib/csv_decision/matchers/numeric.rb +5 -33
  63. data/lib/csv_decision/matchers/pattern.rb +26 -11
  64. data/lib/csv_decision/matchers/range.rb +21 -5
  65. data/lib/csv_decision/matchers/symbol.rb +20 -0
  66. data/lib/csv_decision/matchers.rb +85 -20
  67. data/lib/csv_decision/numeric.rb +38 -0
  68. data/lib/csv_decision/options.rb +36 -27
  69. data/lib/csv_decision/parse.rb +46 -39
  70. data/lib/csv_decision/scan_row.rb +19 -7
  71. data/lib/csv_decision/symbol.rb +73 -0
  72. data/lib/csv_decision/table.rb +24 -18
  73. data/lib/csv_decision.rb +25 -18
  74. data/spec/csv_decision/columns_spec.rb +1 -1
  75. data/spec/csv_decision/constant_spec.rb +60 -0
  76. data/spec/csv_decision/examples_spec.rb +119 -0
  77. data/spec/csv_decision/matchers/function_spec.rb +48 -28
  78. data/spec/csv_decision/matchers/numeric_spec.rb +4 -41
  79. data/spec/csv_decision/matchers/range_spec.rb +31 -61
  80. data/spec/csv_decision/matchers/symbol_spec.rb +65 -0
  81. data/spec/csv_decision/options_spec.rb +14 -2
  82. data/spec/csv_decision/parse_spec.rb +10 -0
  83. data/spec/csv_decision/table_spec.rb +112 -6
  84. data/spec/data/valid/simple_constants.csv +3 -3
  85. metadata +62 -7
  86. data/spec/csv_decision/simple_example_spec.rb +0 -75
  87. /data/spec/{csv_decision.rb → csv_decision_spec.rb} +0 -0
@@ -0,0 +1,1529 @@
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
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";
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 (M)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span>
41
+ &raquo;
42
+ <span class="title">Matchers</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
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">CSVDecision::Matchers</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/csv_decision/matchers.rb<span class="defines">,<br />
98
+ lib/csv_decision.rb,<br /> lib/csv_decision/matchers/range.rb,<br /> lib/csv_decision/matchers/symbol.rb,<br /> lib/csv_decision/matchers/numeric.rb,<br /> lib/csv_decision/matchers/pattern.rb,<br /> lib/csv_decision/matchers/constant.rb,<br /> lib/csv_decision/matchers/function.rb</span>
99
+ </dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>Methods to assign a matcher to data cells</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div><h2>Defined Under Namespace</h2>
116
+ <p class="children">
117
+
118
+
119
+
120
+
121
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Matchers/Constant.html" title="CSVDecision::Matchers::Constant (class)">Constant</a></span>, <span class='object_link'><a href="Matchers/Function.html" title="CSVDecision::Matchers::Function (class)">Function</a></span>, <span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matcher</a></span>, <span class='object_link'><a href="Matchers/Numeric.html" title="CSVDecision::Matchers::Numeric (class)">Numeric</a></span>, <span class='object_link'><a href="Matchers/Pattern.html" title="CSVDecision::Matchers::Pattern (class)">Pattern</a></span>, <span class='object_link'><a href="Matchers/Range.html" title="CSVDecision::Matchers::Range (class)">Range</a></span>, <span class='object_link'><a href="Matchers/Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span>
122
+
123
+
124
+ </p>
125
+
126
+ <h2>Constant Summary</h2>
127
+ <dl class="constants">
128
+
129
+ <dt id="NEGATE-constant" class="">NEGATE =
130
+ <div class="docstring">
131
+ <div class="discussion">
132
+
133
+ <p>Negation sign prefixed to ranges and functions.</p>
134
+
135
+
136
+ </div>
137
+ </div>
138
+ <div class="tags">
139
+
140
+
141
+ </div>
142
+ </dt>
143
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>!</span><span class='tstring_end'>&#39;</span></span></pre></dd>
144
+
145
+ <dt id="EQUALS-constant" class="">EQUALS =
146
+ <div class="docstring">
147
+ <div class="discussion">
148
+
149
+ <p>Cell constants and functions specified by prefixing the value with one of
150
+ these 3 symbols</p>
151
+
152
+
153
+ </div>
154
+ </div>
155
+ <div class="tags">
156
+
157
+
158
+ </div>
159
+ </dt>
160
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>==|:=|=</span><span class='tstring_end'>&#39;</span></span></pre></dd>
161
+
162
+ <dt id="NUMERIC-constant" class="">NUMERIC =
163
+ <div class="docstring">
164
+ <div class="discussion">
165
+
166
+ <p>Regular expression used to recognise a numeric string with or without a
167
+ decimal point.</p>
168
+
169
+
170
+ </div>
171
+ </div>
172
+ <div class="tags">
173
+
174
+
175
+ </div>
176
+ </dt>
177
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[-+]?\d*(?&lt;decimal&gt;\.?)\d*</span><span class='tstring_end'>&#39;</span></span></pre></dd>
178
+
179
+ <dt id="NUMERIC_RE-constant" class="">NUMERIC_RE =
180
+
181
+ </dt>
182
+ <dd><pre class="code"><span class='id identifier rubyid_regexp'>regexp</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#NUMERIC-constant" title="CSVDecision::Matchers::NUMERIC (constant)">NUMERIC</a></span></span><span class='rparen'>)</span></pre></dd>
183
+
184
+ </dl>
185
+
186
+
187
+
188
+
189
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
190
+ <ul class="summary">
191
+
192
+ <li class="public ">
193
+ <span class="summary_signature">
194
+
195
+ <a href="#ins-instance_method" title="#ins (instance method)">#<strong>ins</strong> &#x21d2; Array&lt;Matchers::Matcher&gt; </a>
196
+
197
+
198
+
199
+ </span>
200
+
201
+
202
+
203
+
204
+ <span class="note title readonly">readonly</span>
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+ <span class="summary_desc"><div class='inline'>
215
+ <p>Matchers for the input columns.</p>
216
+ </div></span>
217
+
218
+ </li>
219
+
220
+
221
+ <li class="public ">
222
+ <span class="summary_signature">
223
+
224
+ <a href="#outs-instance_method" title="#outs (instance method)">#<strong>outs</strong> &#x21d2; Array&lt;Matchers::Matcher&gt; </a>
225
+
226
+
227
+
228
+ </span>
229
+
230
+
231
+
232
+
233
+ <span class="note title readonly">readonly</span>
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+ <span class="summary_desc"><div class='inline'>
244
+ <p>Matchers for the output columns.</p>
245
+ </div></span>
246
+
247
+ </li>
248
+
249
+
250
+ </ul>
251
+
252
+
253
+
254
+
255
+
256
+ <h2>
257
+ Class Method Summary
258
+ <small><a href="#" class="summary_toggle">collapse</a></small>
259
+ </h2>
260
+
261
+ <ul class="summary">
262
+
263
+ <li class="public ">
264
+ <span class="summary_signature">
265
+
266
+ <a href="#ins_matchers-class_method" title="ins_matchers (class method)">.<strong>ins_matchers</strong>(options) &#x21d2; Object </a>
267
+
268
+
269
+
270
+ </span>
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+ <span class="summary_desc"><div class='inline'></div></span>
281
+
282
+ </li>
283
+
284
+
285
+ <li class="public ">
286
+ <span class="summary_signature">
287
+
288
+ <a href="#numeric-class_method" title="numeric (class method)">.<strong>numeric</strong>(value) &#x21d2; nil, ... </a>
289
+
290
+
291
+
292
+ </span>
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+ <span class="summary_desc"><div class='inline'>
303
+ <p>Validate a numeric value and convert it to an Integer or BigDecimal if a
304
+ valid numeric string.</p>
305
+ </div></span>
306
+
307
+ </li>
308
+
309
+
310
+ <li class="public ">
311
+ <span class="summary_signature">
312
+
313
+ <a href="#numeric%3F-class_method" title="numeric? (class method)">.<strong>numeric?</strong>(value) &#x21d2; Boolean </a>
314
+
315
+
316
+
317
+ </span>
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+ <span class="summary_desc"><div class='inline'>
328
+ <p>Value is an Integer or a BigDecimal.</p>
329
+ </div></span>
330
+
331
+ </li>
332
+
333
+
334
+ <li class="public ">
335
+ <span class="summary_signature">
336
+
337
+ <a href="#outs_matchers-class_method" title="outs_matchers (class method)">.<strong>outs_matchers</strong>(matchers) &#x21d2; Object </a>
338
+
339
+
340
+
341
+ </span>
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+ <span class="summary_desc"><div class='inline'></div></span>
352
+
353
+ </li>
354
+
355
+
356
+ <li class="public ">
357
+ <span class="summary_signature">
358
+
359
+ <a href="#parse-class_method" title="parse (class method)">.<strong>parse</strong>(columns:, matchers:, row:) &#x21d2; Array&lt;(Array, ScanRow)&gt; </a>
360
+
361
+
362
+
363
+ </span>
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+ <span class="summary_desc"><div class='inline'>
374
+ <p>Parse the supplied input columns for the row supplied using an array of
375
+ matchers.</p>
376
+ </div></span>
377
+
378
+ </li>
379
+
380
+
381
+ <li class="public ">
382
+ <span class="summary_signature">
383
+
384
+ <a href="#regexp-class_method" title="regexp (class method)">.<strong>regexp</strong>(value) &#x21d2; Regexp </a>
385
+
386
+
387
+
388
+ </span>
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+ <span class="summary_desc"><div class='inline'>
399
+ <p>All regular expressions used for matching are anchored inside their own
400
+ non-capturing group.</p>
401
+ </div></span>
402
+
403
+ </li>
404
+
405
+
406
+ <li class="public ">
407
+ <span class="summary_signature">
408
+
409
+ <a href="#scan-class_method" title="scan (class method)">.<strong>scan</strong>(matchers:, cell:) &#x21d2; false, Matchers::Proc </a>
410
+
411
+
412
+
413
+ </span>
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+ <span class="summary_desc"><div class='inline'>
424
+ <p>Scan the table cell against all matches.</p>
425
+ </div></span>
426
+
427
+ </li>
428
+
429
+
430
+ <li class="public ">
431
+ <span class="summary_signature">
432
+
433
+ <a href="#to_numeric-class_method" title="to_numeric (class method)">.<strong>to_numeric</strong>(value) &#x21d2; nil, ... </a>
434
+
435
+
436
+
437
+ </span>
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+ <span class="summary_desc"><div class='inline'>
448
+ <p>Convert a numeric string into an Integer or BigDecimal.</p>
449
+ </div></span>
450
+
451
+ </li>
452
+
453
+
454
+ </ul>
455
+
456
+ <h2>
457
+ Instance Method Summary
458
+ <small><a href="#" class="summary_toggle">collapse</a></small>
459
+ </h2>
460
+
461
+ <ul class="summary">
462
+
463
+ <li class="public ">
464
+ <span class="summary_signature">
465
+
466
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options) &#x21d2; Matchers </a>
467
+
468
+
469
+
470
+ </span>
471
+
472
+
473
+ <span class="note title constructor">constructor</span>
474
+
475
+
476
+
477
+
478
+
479
+
480
+
481
+
482
+ <span class="summary_desc"><div class='inline'>
483
+ <p>A new instance of Matchers.</p>
484
+ </div></span>
485
+
486
+ </li>
487
+
488
+
489
+ <li class="public ">
490
+ <span class="summary_signature">
491
+
492
+ <a href="#parse_ins-instance_method" title="#parse_ins (instance method)">#<strong>parse_ins</strong>(columns:, row:) &#x21d2; Array&lt;(Array, ScanRow)&gt; </a>
493
+
494
+
495
+
496
+ </span>
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+ <span class="summary_desc"><div class='inline'>
507
+ <p>Parse the row&#39;s input columns using the input matchers.</p>
508
+ </div></span>
509
+
510
+ </li>
511
+
512
+
513
+ <li class="public ">
514
+ <span class="summary_signature">
515
+
516
+ <a href="#parse_outs-instance_method" title="#parse_outs (instance method)">#<strong>parse_outs</strong>(columns:, row:) &#x21d2; Array&lt;(Array, ScanRow)&gt; </a>
517
+
518
+
519
+
520
+ </span>
521
+
522
+
523
+
524
+
525
+
526
+
527
+
528
+
529
+
530
+ <span class="summary_desc"><div class='inline'>
531
+ <p>Parse the row&#39;s output columns using the output matchers.</p>
532
+ </div></span>
533
+
534
+ </li>
535
+
536
+
537
+ </ul>
538
+
539
+
540
+ <div id="constructor_details" class="method_details_list">
541
+ <h2>Constructor Details</h2>
542
+
543
+ <div class="method_details first">
544
+ <h3 class="signature first" id="initialize-instance_method">
545
+
546
+ #<strong>initialize</strong>(options) &#x21d2; <tt><span class='object_link'><a href="" title="CSVDecision::Matchers (class)">Matchers</a></span></tt>
547
+
548
+
549
+
550
+
551
+
552
+ </h3><div class="docstring">
553
+ <div class="discussion">
554
+
555
+ <p>Returns a new instance of Matchers</p>
556
+
557
+
558
+ </div>
559
+ </div>
560
+ <div class="tags">
561
+ <p class="tag_title">Parameters:</p>
562
+ <ul class="param">
563
+
564
+ <li>
565
+
566
+ <span class='name'>options</span>
567
+
568
+
569
+ <span class='type'>(<tt>Hash</tt>)</span>
570
+
571
+
572
+
573
+ &mdash;
574
+ <div class='inline'>
575
+ <p>Options hash supplied by the user.</p>
576
+ </div>
577
+
578
+ </li>
579
+
580
+ </ul>
581
+
582
+
583
+ </div><table class="source_code">
584
+ <tr>
585
+ <td>
586
+ <pre class="lines">
587
+
588
+
589
+ 113
590
+ 114
591
+ 115
592
+ 116</pre>
593
+ </td>
594
+ <td>
595
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 113</span>
596
+
597
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
598
+ <span class='ivar'>@ins</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_ins_matchers'><span class='object_link'><a href="#ins_matchers-class_method" title="CSVDecision::Matchers.ins_matchers (method)">ins_matchers</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
599
+ <span class='ivar'>@outs</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_outs_matchers'><span class='object_link'><a href="#outs_matchers-class_method" title="CSVDecision::Matchers.outs_matchers (method)">outs_matchers</a></span></span><span class='lparen'>(</span><span class='ivar'>@ins</span><span class='rparen'>)</span>
600
+ <span class='kw'>end</span></pre>
601
+ </td>
602
+ </tr>
603
+ </table>
604
+ </div>
605
+
606
+ </div>
607
+
608
+ <div id="instance_attr_details" class="attr_details">
609
+ <h2>Instance Attribute Details</h2>
610
+
611
+
612
+ <span id=""></span>
613
+ <div class="method_details first">
614
+ <h3 class="signature first" id="ins-instance_method">
615
+
616
+ #<strong>ins</strong> &#x21d2; <tt>Array&lt;<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>&gt;</tt> <span class="extras">(readonly)</span>
617
+
618
+
619
+
620
+
621
+
622
+ </h3><div class="docstring">
623
+ <div class="discussion">
624
+
625
+ <p>Returns Matchers for the input columns.</p>
626
+
627
+
628
+ </div>
629
+ </div>
630
+ <div class="tags">
631
+
632
+ <p class="tag_title">Returns:</p>
633
+ <ul class="return">
634
+
635
+ <li>
636
+
637
+
638
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>&gt;</tt>)</span>
639
+
640
+
641
+
642
+ &mdash;
643
+ <div class='inline'>
644
+ <p>Matchers for the input columns.</p>
645
+ </div>
646
+
647
+ </li>
648
+
649
+ </ul>
650
+
651
+ </div><table class="source_code">
652
+ <tr>
653
+ <td>
654
+ <pre class="lines">
655
+
656
+
657
+ 107
658
+ 108
659
+ 109</pre>
660
+ </td>
661
+ <td>
662
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 107</span>
663
+
664
+ <span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span>
665
+ <span class='ivar'>@ins</span>
666
+ <span class='kw'>end</span></pre>
667
+ </td>
668
+ </tr>
669
+ </table>
670
+ </div>
671
+
672
+
673
+ <span id=""></span>
674
+ <div class="method_details ">
675
+ <h3 class="signature " id="outs-instance_method">
676
+
677
+ #<strong>outs</strong> &#x21d2; <tt>Array&lt;<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>&gt;</tt> <span class="extras">(readonly)</span>
678
+
679
+
680
+
681
+
682
+
683
+ </h3><div class="docstring">
684
+ <div class="discussion">
685
+
686
+ <p>Returns Matchers for the output columns.</p>
687
+
688
+
689
+ </div>
690
+ </div>
691
+ <div class="tags">
692
+
693
+ <p class="tag_title">Returns:</p>
694
+ <ul class="return">
695
+
696
+ <li>
697
+
698
+
699
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>&gt;</tt>)</span>
700
+
701
+
702
+
703
+ &mdash;
704
+ <div class='inline'>
705
+ <p>Matchers for the output columns.</p>
706
+ </div>
707
+
708
+ </li>
709
+
710
+ </ul>
711
+
712
+ </div><table class="source_code">
713
+ <tr>
714
+ <td>
715
+ <pre class="lines">
716
+
717
+
718
+ 110
719
+ 111
720
+ 112</pre>
721
+ </td>
722
+ <td>
723
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 110</span>
724
+
725
+ <span class='kw'>def</span> <span class='id identifier rubyid_outs'>outs</span>
726
+ <span class='ivar'>@outs</span>
727
+ <span class='kw'>end</span></pre>
728
+ </td>
729
+ </tr>
730
+ </table>
731
+ </div>
732
+
733
+ </div>
734
+
735
+
736
+ <div id="class_method_details" class="method_details_list">
737
+ <h2>Class Method Details</h2>
738
+
739
+
740
+ <div class="method_details first">
741
+ <h3 class="signature first" id="ins_matchers-class_method">
742
+
743
+ .<strong>ins_matchers</strong>(options) &#x21d2; <tt>Object</tt>
744
+
745
+
746
+
747
+
748
+
749
+ </h3><table class="source_code">
750
+ <tr>
751
+ <td>
752
+ <pre class="lines">
753
+
754
+
755
+ 98
756
+ 99
757
+ 100</pre>
758
+ </td>
759
+ <td>
760
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 98</span>
761
+
762
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_ins_matchers'>ins_matchers</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
763
+ <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:matchers</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_klass'>klass</span><span class='op'>|</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
764
+ <span class='kw'>end</span></pre>
765
+ </td>
766
+ </tr>
767
+ </table>
768
+ </div>
769
+
770
+ <div class="method_details ">
771
+ <h3 class="signature " id="numeric-class_method">
772
+
773
+ .<strong>numeric</strong>(value) &#x21d2; <tt>nil</tt>, ...
774
+
775
+
776
+
777
+
778
+
779
+ </h3><div class="docstring">
780
+ <div class="discussion">
781
+
782
+ <p>Validate a numeric value and convert it to an Integer or BigDecimal if a
783
+ valid numeric string.</p>
784
+
785
+
786
+ </div>
787
+ </div>
788
+ <div class="tags">
789
+ <p class="tag_title">Parameters:</p>
790
+ <ul class="param">
791
+
792
+ <li>
793
+
794
+ <span class='name'>value</span>
795
+
796
+
797
+ <span class='type'>(<tt>nil</tt>, <tt>String</tt>, <tt>Integer</tt>, <tt>BigDecimal</tt>)</span>
798
+
799
+
800
+
801
+ </li>
802
+
803
+ </ul>
804
+
805
+ <p class="tag_title">Returns:</p>
806
+ <ul class="return">
807
+
808
+ <li>
809
+
810
+
811
+ <span class='type'>(<tt>nil</tt>, <tt>Integer</tt>, <tt>BigDecimal</tt>)</span>
812
+
813
+
814
+
815
+ </li>
816
+
817
+ </ul>
818
+
819
+ </div><table class="source_code">
820
+ <tr>
821
+ <td>
822
+ <pre class="lines">
823
+
824
+
825
+ 43
826
+ 44
827
+ 45
828
+ 46
829
+ 47
830
+ 48</pre>
831
+ </td>
832
+ <td>
833
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 43</span>
834
+
835
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
836
+ <span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_numeric?'>numeric?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
837
+ <span class='kw'>return</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>
838
+
839
+ <span class='id identifier rubyid_to_numeric'>to_numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
840
+ <span class='kw'>end</span></pre>
841
+ </td>
842
+ </tr>
843
+ </table>
844
+ </div>
845
+
846
+ <div class="method_details ">
847
+ <h3 class="signature " id="numeric?-class_method">
848
+
849
+ .<strong>numeric?</strong>(value) &#x21d2; <tt>Boolean</tt>
850
+
851
+
852
+
853
+
854
+
855
+ </h3><div class="docstring">
856
+ <div class="discussion">
857
+
858
+ <p>Returns Value is an Integer or a BigDecimal.</p>
859
+
860
+
861
+ </div>
862
+ </div>
863
+ <div class="tags">
864
+ <p class="tag_title">Parameters:</p>
865
+ <ul class="param">
866
+
867
+ <li>
868
+
869
+ <span class='name'>value</span>
870
+
871
+
872
+ <span class='type'>(<tt>Object</tt>)</span>
873
+
874
+
875
+
876
+ &mdash;
877
+ <div class='inline'>
878
+ <p>Value from the input hash.</p>
879
+ </div>
880
+
881
+ </li>
882
+
883
+ </ul>
884
+
885
+ <p class="tag_title">Returns:</p>
886
+ <ul class="return">
887
+
888
+ <li>
889
+
890
+
891
+ <span class='type'>(<tt>Boolean</tt>)</span>
892
+
893
+
894
+
895
+ &mdash;
896
+ <div class='inline'>
897
+ <p>Value is an Integer or a BigDecimal.</p>
898
+ </div>
899
+
900
+ </li>
901
+
902
+ </ul>
903
+
904
+ </div><table class="source_code">
905
+ <tr>
906
+ <td>
907
+ <pre class="lines">
908
+
909
+
910
+ 35
911
+ 36
912
+ 37</pre>
913
+ </td>
914
+ <td>
915
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 35</span>
916
+
917
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_numeric?'>numeric?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
918
+ <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'>Integer</span><span class='rparen'>)</span> <span class='op'>||</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'>BigDecimal</span><span class='rparen'>)</span>
919
+ <span class='kw'>end</span></pre>
920
+ </td>
921
+ </tr>
922
+ </table>
923
+ </div>
924
+
925
+ <div class="method_details ">
926
+ <h3 class="signature " id="outs_matchers-class_method">
927
+
928
+ .<strong>outs_matchers</strong>(matchers) &#x21d2; <tt>Object</tt>
929
+
930
+
931
+
932
+
933
+
934
+ </h3><table class="source_code">
935
+ <tr>
936
+ <td>
937
+ <pre class="lines">
938
+
939
+
940
+ 102
941
+ 103
942
+ 104</pre>
943
+ </td>
944
+ <td>
945
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 102</span>
946
+
947
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_outs_matchers'>outs_matchers</span><span class='lparen'>(</span><span class='id identifier rubyid_matchers'>matchers</span><span class='rparen'>)</span>
948
+ <span class='id identifier rubyid_matchers'>matchers</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_obj'>obj</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="../CSVDecision.html#OUTS_MATCHERS-constant" title="CSVDecision::OUTS_MATCHERS (constant)">OUTS_MATCHERS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
949
+ <span class='kw'>end</span></pre>
950
+ </td>
951
+ </tr>
952
+ </table>
953
+ </div>
954
+
955
+ <div class="method_details ">
956
+ <h3 class="signature " id="parse-class_method">
957
+
958
+ .<strong>parse</strong>(columns:, matchers:, row:) &#x21d2; <tt>Array&lt;(Array, <span class='object_link'><a href="ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>)&gt;</tt>
959
+
960
+
961
+
962
+
963
+
964
+ </h3><div class="docstring">
965
+ <div class="discussion">
966
+
967
+ <p>Parse the supplied input columns for the row supplied using an array of
968
+ matchers.</p>
969
+
970
+
971
+ </div>
972
+ </div>
973
+ <div class="tags">
974
+ <p class="tag_title">Parameters:</p>
975
+ <ul class="param">
976
+
977
+ <li>
978
+
979
+ <span class='name'>columns</span>
980
+
981
+
982
+ <span class='type'>(<tt>Hash{Integer=&gt;<span class='object_link'><a href="Columns/Entry.html" title="CSVDecision::Columns::Entry (class)">Columns::Entry</a></span>}</tt>)</span>
983
+
984
+
985
+
986
+ &mdash;
987
+ <div class='inline'>
988
+ <p>Input columns hash.</p>
989
+ </div>
990
+
991
+ </li>
992
+
993
+ <li>
994
+
995
+ <span class='name'>matchers</span>
996
+
997
+
998
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>&gt;</tt>)</span>
999
+
1000
+
1001
+
1002
+ </li>
1003
+
1004
+ <li>
1005
+
1006
+ <span class='name'>row</span>
1007
+
1008
+
1009
+ <span class='type'>(<tt>Array&lt;String&gt;</tt>)</span>
1010
+
1011
+
1012
+
1013
+ &mdash;
1014
+ <div class='inline'>
1015
+ <p>Data row being parsed.</p>
1016
+ </div>
1017
+
1018
+ </li>
1019
+
1020
+ </ul>
1021
+
1022
+ <p class="tag_title">Returns:</p>
1023
+ <ul class="return">
1024
+
1025
+ <li>
1026
+
1027
+
1028
+ <span class='type'>(<tt>Array&lt;(Array, <span class='object_link'><a href="ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>)&gt;</tt>)</span>
1029
+
1030
+
1031
+
1032
+ &mdash;
1033
+ <div class='inline'>
1034
+ <p>Used to scan a table row against an input hash for matches.</p>
1035
+ </div>
1036
+
1037
+ </li>
1038
+
1039
+ </ul>
1040
+
1041
+ </div><table class="source_code">
1042
+ <tr>
1043
+ <td>
1044
+ <pre class="lines">
1045
+
1046
+
1047
+ 71
1048
+ 72
1049
+ 73
1050
+ 74
1051
+ 75
1052
+ 76
1053
+ 77
1054
+ 78
1055
+ 79
1056
+ 80
1057
+ 81</pre>
1058
+ </td>
1059
+ <td>
1060
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 71</span>
1061
+
1062
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>matchers:</span><span class='comma'>,</span> <span class='label'>row:</span><span class='rparen'>)</span>
1063
+ <span class='comment'># Build an array of column indexes requiring simple constant matches,
1064
+ </span> <span class='comment'># and a second array of columns requiring special matchers.
1065
+ </span> <span class='id identifier rubyid_scan_row'>scan_row</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ScanRow.html#initialize-instance_method" title="CSVDecision::ScanRow#initialize (method)">new</a></span></span>
1066
+
1067
+ <span class='id identifier rubyid_row'>row</span> <span class='op'>=</span> <span class='id identifier rubyid_scan_row'>scan_row</span><span class='period'>.</span><span class='id identifier rubyid_scan_columns'>scan_columns</span><span class='lparen'>(</span><span class='label'>columns:</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='label'>matchers:</span> <span class='id identifier rubyid_matchers'>matchers</span><span class='comma'>,</span> <span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
1068
+
1069
+ <span class='id identifier rubyid_scan_row'>scan_row</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
1070
+
1071
+ <span class='lbracket'>[</span><span class='id identifier rubyid_row'>row</span><span class='comma'>,</span> <span class='id identifier rubyid_scan_row'>scan_row</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='rbracket'>]</span>
1072
+ <span class='kw'>end</span></pre>
1073
+ </td>
1074
+ </tr>
1075
+ </table>
1076
+ </div>
1077
+
1078
+ <div class="method_details ">
1079
+ <h3 class="signature " id="regexp-class_method">
1080
+
1081
+ .<strong>regexp</strong>(value) &#x21d2; <tt>Regexp</tt>
1082
+
1083
+
1084
+
1085
+
1086
+
1087
+ </h3><div class="docstring">
1088
+ <div class="discussion">
1089
+
1090
+ <p>All regular expressions used for matching are anchored inside their own
1091
+ non-capturing group.</p>
1092
+
1093
+
1094
+ </div>
1095
+ </div>
1096
+ <div class="tags">
1097
+ <p class="tag_title">Parameters:</p>
1098
+ <ul class="param">
1099
+
1100
+ <li>
1101
+
1102
+ <span class='name'>value</span>
1103
+
1104
+
1105
+ <span class='type'>(<tt>String</tt>)</span>
1106
+
1107
+
1108
+
1109
+ &mdash;
1110
+ <div class='inline'>
1111
+ <p>String used to form an anchored regular expression.</p>
1112
+ </div>
1113
+
1114
+ </li>
1115
+
1116
+ </ul>
1117
+
1118
+ <p class="tag_title">Returns:</p>
1119
+ <ul class="return">
1120
+
1121
+ <li>
1122
+
1123
+
1124
+ <span class='type'>(<tt>Regexp</tt>)</span>
1125
+
1126
+
1127
+
1128
+ &mdash;
1129
+ <div class='inline'>
1130
+ <p>Anchored, frozen regular expression.</p>
1131
+ </div>
1132
+
1133
+ </li>
1134
+
1135
+ </ul>
1136
+
1137
+ </div><table class="source_code">
1138
+ <tr>
1139
+ <td>
1140
+ <pre class="lines">
1141
+
1142
+
1143
+ 25
1144
+ 26
1145
+ 27</pre>
1146
+ </td>
1147
+ <td>
1148
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 25</span>
1149
+
1150
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_regexp'>regexp</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1151
+ <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\\A(?:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>)\\z</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
1152
+ <span class='kw'>end</span></pre>
1153
+ </td>
1154
+ </tr>
1155
+ </table>
1156
+ </div>
1157
+
1158
+ <div class="method_details ">
1159
+ <h3 class="signature " id="scan-class_method">
1160
+
1161
+ .<strong>scan</strong>(matchers:, cell:) &#x21d2; <tt>false</tt>, <tt>Matchers::Proc</tt>
1162
+
1163
+
1164
+
1165
+
1166
+
1167
+ </h3><div class="docstring">
1168
+ <div class="discussion">
1169
+
1170
+ <p>Scan the table cell against all matches.</p>
1171
+
1172
+
1173
+ </div>
1174
+ </div>
1175
+ <div class="tags">
1176
+ <p class="tag_title">Parameters:</p>
1177
+ <ul class="param">
1178
+
1179
+ <li>
1180
+
1181
+ <span class='name'>matchers</span>
1182
+
1183
+
1184
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>&gt;</tt>)</span>
1185
+
1186
+
1187
+
1188
+ </li>
1189
+
1190
+ <li>
1191
+
1192
+ <span class='name'>cell</span>
1193
+
1194
+
1195
+ <span class='type'>(<tt>String</tt>)</span>
1196
+
1197
+
1198
+
1199
+ </li>
1200
+
1201
+ </ul>
1202
+
1203
+ <p class="tag_title">Returns:</p>
1204
+ <ul class="return">
1205
+
1206
+ <li>
1207
+
1208
+
1209
+ <span class='type'>(<tt>false</tt>, <tt>Matchers::Proc</tt>)</span>
1210
+
1211
+
1212
+
1213
+ </li>
1214
+
1215
+ </ul>
1216
+
1217
+ </div><table class="source_code">
1218
+ <tr>
1219
+ <td>
1220
+ <pre class="lines">
1221
+
1222
+
1223
+ 88
1224
+ 89
1225
+ 90
1226
+ 91
1227
+ 92
1228
+ 93
1229
+ 94
1230
+ 95
1231
+ 96</pre>
1232
+ </td>
1233
+ <td>
1234
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 88</span>
1235
+
1236
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='label'>matchers:</span><span class='comma'>,</span> <span class='label'>cell:</span><span class='rparen'>)</span>
1237
+ <span class='id identifier rubyid_matchers'>matchers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_matcher'>matcher</span><span class='op'>|</span>
1238
+ <span class='id identifier rubyid_proc'>proc</span> <span class='op'>=</span> <span class='id identifier rubyid_matcher'>matcher</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>
1239
+ <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>
1240
+ <span class='kw'>end</span>
1241
+
1242
+ <span class='comment'># Must be a simple constant
1243
+ </span> <span class='kw'>false</span>
1244
+ <span class='kw'>end</span></pre>
1245
+ </td>
1246
+ </tr>
1247
+ </table>
1248
+ </div>
1249
+
1250
+ <div class="method_details ">
1251
+ <h3 class="signature " id="to_numeric-class_method">
1252
+
1253
+ .<strong>to_numeric</strong>(value) &#x21d2; <tt>nil</tt>, ...
1254
+
1255
+
1256
+
1257
+
1258
+
1259
+ </h3><div class="docstring">
1260
+ <div class="discussion">
1261
+
1262
+ <p>Convert a numeric string into an Integer or BigDecimal.</p>
1263
+
1264
+
1265
+ </div>
1266
+ </div>
1267
+ <div class="tags">
1268
+ <p class="tag_title">Parameters:</p>
1269
+ <ul class="param">
1270
+
1271
+ <li>
1272
+
1273
+ <span class='name'>value</span>
1274
+
1275
+
1276
+ <span class='type'>(<tt>String</tt>)</span>
1277
+
1278
+
1279
+
1280
+ </li>
1281
+
1282
+ </ul>
1283
+
1284
+ <p class="tag_title">Returns:</p>
1285
+ <ul class="return">
1286
+
1287
+ <li>
1288
+
1289
+
1290
+ <span class='type'>(<tt>nil</tt>, <tt>Integer</tt>, <tt>BigDecimal</tt>)</span>
1291
+
1292
+
1293
+
1294
+ </li>
1295
+
1296
+ </ul>
1297
+
1298
+ </div><table class="source_code">
1299
+ <tr>
1300
+ <td>
1301
+ <pre class="lines">
1302
+
1303
+
1304
+ 54
1305
+ 55
1306
+ 56
1307
+ 57</pre>
1308
+ </td>
1309
+ <td>
1310
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 54</span>
1311
+
1312
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_numeric'>to_numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1313
+ <span class='kw'>return</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="#NUMERIC_RE-constant" title="CSVDecision::Matchers::NUMERIC_RE (constant)">NUMERIC_RE</a></span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rparen'>)</span>
1314
+ <span class='id identifier rubyid_coerce_numeric'>coerce_numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_match'>match</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1315
+ <span class='kw'>end</span></pre>
1316
+ </td>
1317
+ </tr>
1318
+ </table>
1319
+ </div>
1320
+
1321
+ </div>
1322
+
1323
+ <div id="instance_method_details" class="method_details_list">
1324
+ <h2>Instance Method Details</h2>
1325
+
1326
+
1327
+ <div class="method_details first">
1328
+ <h3 class="signature first" id="parse_ins-instance_method">
1329
+
1330
+ #<strong>parse_ins</strong>(columns:, row:) &#x21d2; <tt>Array&lt;(Array, <span class='object_link'><a href="ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>)&gt;</tt>
1331
+
1332
+
1333
+
1334
+
1335
+
1336
+ </h3><div class="docstring">
1337
+ <div class="discussion">
1338
+
1339
+ <p>Parse the row&#39;s input columns using the input matchers.</p>
1340
+
1341
+
1342
+ </div>
1343
+ </div>
1344
+ <div class="tags">
1345
+ <p class="tag_title">Parameters:</p>
1346
+ <ul class="param">
1347
+
1348
+ <li>
1349
+
1350
+ <span class='name'>columns</span>
1351
+
1352
+
1353
+ <span class='type'>(<tt>Hash{Integer=&gt;<span class='object_link'><a href="Columns/Entry.html" title="CSVDecision::Columns::Entry (class)">Columns::Entry</a></span>}</tt>)</span>
1354
+
1355
+
1356
+
1357
+ &mdash;
1358
+ <div class='inline'>
1359
+ <p>Input columns hash.</p>
1360
+ </div>
1361
+
1362
+ </li>
1363
+
1364
+ <li>
1365
+
1366
+ <span class='name'>row</span>
1367
+
1368
+
1369
+ <span class='type'>(<tt>Array&lt;String&gt;</tt>)</span>
1370
+
1371
+
1372
+
1373
+ &mdash;
1374
+ <div class='inline'>
1375
+ <p>Data row being parsed.</p>
1376
+ </div>
1377
+
1378
+ </li>
1379
+
1380
+ </ul>
1381
+
1382
+ <p class="tag_title">Returns:</p>
1383
+ <ul class="return">
1384
+
1385
+ <li>
1386
+
1387
+
1388
+ <span class='type'>(<tt>Array&lt;(Array, <span class='object_link'><a href="ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>)&gt;</tt>)</span>
1389
+
1390
+
1391
+
1392
+ &mdash;
1393
+ <div class='inline'>
1394
+ <p>Used to scan a table row against an input hash for matches.</p>
1395
+ </div>
1396
+
1397
+ </li>
1398
+
1399
+ </ul>
1400
+
1401
+ </div><table class="source_code">
1402
+ <tr>
1403
+ <td>
1404
+ <pre class="lines">
1405
+
1406
+
1407
+ 123
1408
+ 124
1409
+ 125</pre>
1410
+ </td>
1411
+ <td>
1412
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 123</span>
1413
+
1414
+ <span class='kw'>def</span> <span class='id identifier rubyid_parse_ins'>parse_ins</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>row:</span><span class='rparen'>)</span>
1415
+ <span class='const'><span class='object_link'><a href="" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="#parse-class_method" title="CSVDecision::Matchers.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='label'>columns:</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='label'>matchers:</span> <span class='ivar'>@ins</span><span class='comma'>,</span> <span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
1416
+ <span class='kw'>end</span></pre>
1417
+ </td>
1418
+ </tr>
1419
+ </table>
1420
+ </div>
1421
+
1422
+ <div class="method_details ">
1423
+ <h3 class="signature " id="parse_outs-instance_method">
1424
+
1425
+ #<strong>parse_outs</strong>(columns:, row:) &#x21d2; <tt>Array&lt;(Array, <span class='object_link'><a href="ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>)&gt;</tt>
1426
+
1427
+
1428
+
1429
+
1430
+
1431
+ </h3><div class="docstring">
1432
+ <div class="discussion">
1433
+
1434
+ <p>Parse the row&#39;s output columns using the output matchers.</p>
1435
+
1436
+
1437
+ </div>
1438
+ </div>
1439
+ <div class="tags">
1440
+ <p class="tag_title">Parameters:</p>
1441
+ <ul class="param">
1442
+
1443
+ <li>
1444
+
1445
+ <span class='name'>columns</span>
1446
+
1447
+
1448
+ <span class='type'>(<tt>Hash{Integer=&gt;<span class='object_link'><a href="Columns/Entry.html" title="CSVDecision::Columns::Entry (class)">Columns::Entry</a></span>}</tt>)</span>
1449
+
1450
+
1451
+
1452
+ &mdash;
1453
+ <div class='inline'>
1454
+ <p>Input columns hash.</p>
1455
+ </div>
1456
+
1457
+ </li>
1458
+
1459
+ <li>
1460
+
1461
+ <span class='name'>row</span>
1462
+
1463
+
1464
+ <span class='type'>(<tt>Array&lt;String&gt;</tt>)</span>
1465
+
1466
+
1467
+
1468
+ &mdash;
1469
+ <div class='inline'>
1470
+ <p>Data row being parsed.</p>
1471
+ </div>
1472
+
1473
+ </li>
1474
+
1475
+ </ul>
1476
+
1477
+ <p class="tag_title">Returns:</p>
1478
+ <ul class="return">
1479
+
1480
+ <li>
1481
+
1482
+
1483
+ <span class='type'>(<tt>Array&lt;(Array, <span class='object_link'><a href="ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>)&gt;</tt>)</span>
1484
+
1485
+
1486
+
1487
+ &mdash;
1488
+ <div class='inline'>
1489
+ <p>Used to scan a table row against an input hash for matches.</p>
1490
+ </div>
1491
+
1492
+ </li>
1493
+
1494
+ </ul>
1495
+
1496
+ </div><table class="source_code">
1497
+ <tr>
1498
+ <td>
1499
+ <pre class="lines">
1500
+
1501
+
1502
+ 132
1503
+ 133
1504
+ 134</pre>
1505
+ </td>
1506
+ <td>
1507
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 132</span>
1508
+
1509
+ <span class='kw'>def</span> <span class='id identifier rubyid_parse_outs'>parse_outs</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>row:</span><span class='rparen'>)</span>
1510
+ <span class='const'><span class='object_link'><a href="" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="#parse-class_method" title="CSVDecision::Matchers.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='label'>columns:</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='label'>matchers:</span> <span class='ivar'>@outs</span><span class='comma'>,</span> <span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
1511
+ <span class='kw'>end</span></pre>
1512
+ </td>
1513
+ </tr>
1514
+ </table>
1515
+ </div>
1516
+
1517
+ </div>
1518
+
1519
+ </div>
1520
+
1521
+ <div id="footer">
1522
+ Generated on Tue Dec 26 18:31:37 2017 by
1523
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1524
+ 0.9.12 (ruby-2.3.0).
1525
+ </div>
1526
+
1527
+ </div>
1528
+ </body>
1529
+ </html>