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,652 @@
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
+ Module: CSVDecision
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";
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 (C)</a> &raquo;
40
+
41
+
42
+ <span class="title">CSVDecision</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>Module: CSVDecision
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/csv_decision.rb<span class="defines">,<br />
82
+ lib/csv_decision/data.rb,<br /> lib/csv_decision/load.rb,<br /> lib/csv_decision/input.rb,<br /> lib/csv_decision/parse.rb,<br /> lib/csv_decision/table.rb,<br /> lib/csv_decision/decide.rb,<br /> lib/csv_decision/header.rb,<br /> lib/csv_decision/symbol.rb,<br /> lib/csv_decision/columns.rb,<br /> lib/csv_decision/numeric.rb,<br /> lib/csv_decision/options.rb,<br /> lib/csv_decision/constant.rb,<br /> lib/csv_decision/decision.rb,<br /> lib/csv_decision/function.rb,<br /> lib/csv_decision/matchers.rb,<br /> lib/csv_decision/scan_row.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>
83
+ </dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Overview</h2><div class="docstring">
89
+ <div class="discussion">
90
+
91
+ <p>CSV Decision: CSV based Ruby decision tables. Created December 2017 by
92
+ Brett Vickers See LICENSE and README.md for details.</p>
93
+
94
+
95
+ </div>
96
+ </div>
97
+ <div class="tags">
98
+
99
+
100
+ </div><h2>Defined Under Namespace</h2>
101
+ <p class="children">
102
+
103
+
104
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="CSVDecision/Constant.html" title="CSVDecision::Constant (module)">Constant</a></span>, <span class='object_link'><a href="CSVDecision/Data.html" title="CSVDecision::Data (module)">Data</a></span>, <span class='object_link'><a href="CSVDecision/Decide.html" title="CSVDecision::Decide (module)">Decide</a></span>, <span class='object_link'><a href="CSVDecision/Function.html" title="CSVDecision::Function (module)">Function</a></span>, <span class='object_link'><a href="CSVDecision/Header.html" title="CSVDecision::Header (module)">Header</a></span>, <span class='object_link'><a href="CSVDecision/Input.html" title="CSVDecision::Input (module)">Input</a></span>, <span class='object_link'><a href="CSVDecision/Load.html" title="CSVDecision::Load (module)">Load</a></span>, <span class='object_link'><a href="CSVDecision/Numeric.html" title="CSVDecision::Numeric (module)">Numeric</a></span>, <span class='object_link'><a href="CSVDecision/Options.html" title="CSVDecision::Options (module)">Options</a></span>, <span class='object_link'><a href="CSVDecision/Parse.html" title="CSVDecision::Parse (module)">Parse</a></span>, <span class='object_link'><a href="CSVDecision/Symbol.html" title="CSVDecision::Symbol (module)">Symbol</a></span>
105
+
106
+
107
+
108
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="CSVDecision/CellValidationError.html" title="CSVDecision::CellValidationError (class)">CellValidationError</a></span>, <span class='object_link'><a href="CSVDecision/Columns.html" title="CSVDecision::Columns (class)">Columns</a></span>, <span class='object_link'><a href="CSVDecision/Decision.html" title="CSVDecision::Decision (class)">Decision</a></span>, <span class='object_link'><a href="CSVDecision/Error.html" title="CSVDecision::Error (class)">Error</a></span>, <span class='object_link'><a href="CSVDecision/FileError.html" title="CSVDecision::FileError (class)">FileError</a></span>, <span class='object_link'><a href="CSVDecision/Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span>, <span class='object_link'><a href="CSVDecision/ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>, <span class='object_link'><a href="CSVDecision/Table.html" title="CSVDecision::Table (class)">Table</a></span>
109
+
110
+
111
+ </p>
112
+
113
+ <h2>Constant Summary</h2>
114
+ <dl class="constants">
115
+
116
+ <dt id="COMMENT_CHARACTER-constant" class="">COMMENT_CHARACTER =
117
+
118
+ </dt>
119
+ <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>
120
+
121
+ <dt id="DEFAULT_MATCHERS-constant" class="">DEFAULT_MATCHERS =
122
+ <div class="docstring">
123
+ <div class="discussion">
124
+
125
+ <p>Specialized cell value matchers beyond simple string compares. By default
126
+ all these matchers are tried in the specified order.</p>
127
+
128
+
129
+ </div>
130
+ </div>
131
+ <div class="tags">
132
+
133
+
134
+ </div>
135
+ </dt>
136
+ <dd><pre class="code"><span class='lbracket'>[</span>
137
+ <span class='const'><span class='object_link'><a href="CSVDecision/Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="CSVDecision/Matchers/Range.html" title="CSVDecision::Matchers::Range (class)">Range</a></span></span><span class='comma'>,</span>
138
+ <span class='const'><span class='object_link'><a href="CSVDecision/Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="CSVDecision/Matchers/Numeric.html" title="CSVDecision::Matchers::Numeric (class)">Numeric</a></span></span><span class='comma'>,</span>
139
+ <span class='const'><span class='object_link'><a href="CSVDecision/Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="CSVDecision/Matchers/Pattern.html" title="CSVDecision::Matchers::Pattern (class)">Pattern</a></span></span><span class='comma'>,</span>
140
+ <span class='const'><span class='object_link'><a href="CSVDecision/Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="CSVDecision/Matchers/Constant.html" title="CSVDecision::Matchers::Constant (class)">Constant</a></span></span><span class='comma'>,</span>
141
+ <span class='const'><span class='object_link'><a href="CSVDecision/Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="CSVDecision/Matchers/Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span></span>
142
+ <span class='comment'># Matchers::Function
143
+ </span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
144
+
145
+ <dt id="OUTS_MATCHERS-constant" class="">OUTS_MATCHERS =
146
+ <div class="docstring">
147
+ <div class="discussion">
148
+
149
+ <p>Subset of matchers that apply to output cells</p>
150
+
151
+
152
+ </div>
153
+ </div>
154
+ <div class="tags">
155
+
156
+
157
+ </div>
158
+ </dt>
159
+ <dd><pre class="code"><span class='lbracket'>[</span>
160
+ <span class='const'><span class='object_link'><a href="CSVDecision/Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="CSVDecision/Matchers/Constant.html" title="CSVDecision::Matchers::Constant (class)">Constant</a></span></span>
161
+ <span class='comment'># Matchers::Function
162
+ </span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
163
+
164
+ <dt id="Proc-constant" class="">Proc =
165
+ <div class="docstring">
166
+ <div class="discussion">
167
+
168
+ <p>Value object for a cell proc.</p>
169
+
170
+
171
+ </div>
172
+ </div>
173
+ <div class="tags">
174
+
175
+
176
+ </div>
177
+ </dt>
178
+ <dd><pre class="code"><span class='const'>Value</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:type</span><span class='comma'>,</span> <span class='symbol'>:function</span><span class='rparen'>)</span></pre></dd>
179
+
180
+ </dl>
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <h2>
190
+ Class Method Summary
191
+ <small><a href="#" class="summary_toggle">collapse</a></small>
192
+ </h2>
193
+
194
+ <ul class="summary">
195
+
196
+ <li class="public ">
197
+ <span class="summary_signature">
198
+
199
+ <a href="#load-class_method" title="load (class method)">.<strong>load</strong>(path, options = {}) &#x21d2; Hash&lt;CSVDecision::Table&gt; </a>
200
+
201
+
202
+
203
+ </span>
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+ <span class="summary_desc"><div class='inline'>
214
+ <p>Load all the CSV files located in the designated folder path.</p>
215
+ </div></span>
216
+
217
+ </li>
218
+
219
+
220
+ <li class="public ">
221
+ <span class="summary_signature">
222
+
223
+ <a href="#parse-class_method" title="parse (class method)">.<strong>parse</strong>(data, options = {}) &#x21d2; CSVDecision::Table </a>
224
+
225
+
226
+
227
+ </span>
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+ <span class="summary_desc"><div class='inline'>
238
+ <p>Builds a decision table from the input data - which may either be a file,
239
+ CSV string or an array of arrays.</p>
240
+ </div></span>
241
+
242
+ </li>
243
+
244
+
245
+ <li class="public ">
246
+ <span class="summary_signature">
247
+
248
+ <a href="#root-class_method" title="root (class method)">.<strong>root</strong> &#x21d2; String </a>
249
+
250
+
251
+
252
+ </span>
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+ <span class="summary_desc"><div class='inline'>
263
+ <p>Gem project&#39;s root directory.</p>
264
+ </div></span>
265
+
266
+ </li>
267
+
268
+
269
+ </ul>
270
+
271
+
272
+
273
+
274
+ <div id="class_method_details" class="method_details_list">
275
+ <h2>Class Method Details</h2>
276
+
277
+
278
+ <div class="method_details first">
279
+ <h3 class="signature first" id="load-class_method">
280
+
281
+ .<strong>load</strong>(path, options = {}) &#x21d2; <tt>Hash&lt;<span class='object_link'><a href="CSVDecision/Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span>&gt;</tt>
282
+
283
+
284
+
285
+
286
+
287
+ </h3><div class="docstring">
288
+ <div class="discussion">
289
+
290
+ <p>Load all the CSV files located in the designated folder path.</p>
291
+
292
+
293
+ </div>
294
+ </div>
295
+ <div class="tags">
296
+ <p class="tag_title">Parameters:</p>
297
+ <ul class="param">
298
+
299
+ <li>
300
+
301
+ <span class='name'>path</span>
302
+
303
+
304
+ <span class='type'>(<tt>Pathname</tt>)</span>
305
+
306
+
307
+
308
+ &mdash;
309
+ <div class='inline'><ul><li>
310
+ <p>directiory containing CSV files</p>
311
+ </li></ul>
312
+ </div>
313
+
314
+ </li>
315
+
316
+ <li>
317
+
318
+ <span class='name'>options</span>
319
+
320
+
321
+ <span class='type'>(<tt>Hash</tt>)</span>
322
+
323
+
324
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
325
+
326
+
327
+ &mdash;
328
+ <div class='inline'><ul><li>
329
+ <p>supplied options hash for table creation</p>
330
+ </li></ul>
331
+ </div>
332
+
333
+ </li>
334
+
335
+ </ul>
336
+
337
+ <p class="tag_title">Returns:</p>
338
+ <ul class="return">
339
+
340
+ <li>
341
+
342
+
343
+ <span class='type'>(<tt>Hash&lt;<span class='object_link'><a href="CSVDecision/Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span>&gt;</tt>)</span>
344
+
345
+
346
+
347
+ </li>
348
+
349
+ </ul>
350
+
351
+ </div><table class="source_code">
352
+ <tr>
353
+ <td>
354
+ <pre class="lines">
355
+
356
+
357
+ 12
358
+ 13
359
+ 14</pre>
360
+ </td>
361
+ <td>
362
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/load.rb', line 12</span>
363
+
364
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
365
+ <span class='const'><span class='object_link'><a href="CSVDecision/Load.html" title="CSVDecision::Load (module)">Load</a></span></span><span class='period'>.</span><span class='id identifier rubyid_path'><span class='object_link'><a href="CSVDecision/Load.html#path-class_method" title="CSVDecision::Load.path (method)">path</a></span></span><span class='lparen'>(</span><span class='label'>path:</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
366
+ <span class='kw'>end</span></pre>
367
+ </td>
368
+ </tr>
369
+ </table>
370
+ </div>
371
+
372
+ <div class="method_details ">
373
+ <h3 class="signature " id="parse-class_method">
374
+
375
+ .<strong>parse</strong>(data, options = {}) &#x21d2; <tt><span class='object_link'><a href="CSVDecision/Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>
376
+
377
+
378
+
379
+
380
+
381
+ </h3><div class="docstring">
382
+ <div class="discussion">
383
+
384
+ <p>Builds a decision table from the input data - which may either be a file,
385
+ CSV string or an array of arrays.</p>
386
+
387
+
388
+ </div>
389
+ </div>
390
+ <div class="tags">
391
+
392
+ <div class="examples">
393
+ <p class="tag_title">Examples:</p>
394
+
395
+
396
+ <p class="example_title"><div class='inline'>
397
+ <p>Simple Example</p>
398
+ </div></p>
399
+
400
+ <pre class="example code"><code>If you have cloned the gem&#39;s git repo, then you can run:
401
+ table = CSVDecision.parse(Pathname(&#39;spec/data/valid/simple_example.csv&#39;)) #=&gt; CSVDecision::Table
402
+ table.decide(topic: &#39;finance&#39;, region: &#39;Europe&#39;) #=&gt; team_member: &#39;Donald&#39;</code></pre>
403
+
404
+ </div>
405
+ <p class="tag_title">Parameters:</p>
406
+ <ul class="param">
407
+
408
+ <li>
409
+
410
+ <span class='name'>data</span>
411
+
412
+
413
+ <span class='type'>(<tt>Pathname</tt>, <tt>File</tt>, <tt>Array&lt;Array&lt;String&gt;&gt;</tt>, <tt>String</tt>)</span>
414
+
415
+
416
+
417
+ &mdash;
418
+ <div class='inline'>
419
+ <p>input data given as a CSV file, array of arrays or CSV string.</p>
420
+ </div>
421
+
422
+ </li>
423
+
424
+ <li>
425
+
426
+ <span class='name'>options</span>
427
+
428
+
429
+ <span class='type'>(<tt>Hash</tt>)</span>
430
+
431
+
432
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
433
+
434
+
435
+ &mdash;
436
+ <div class='inline'>
437
+ <p>Options hash supplied by the user.</p>
438
+ </div>
439
+
440
+ </li>
441
+
442
+ </ul>
443
+
444
+
445
+
446
+
447
+
448
+
449
+ <p class="tag_title">Options Hash (<tt>options</tt>):</p>
450
+ <ul class="option">
451
+
452
+ <li>
453
+ <span class="name">:first_match</span>
454
+ <span class="type">(<tt>Boolean</tt>)</span>
455
+ <span class="default">
456
+
457
+ </span>
458
+
459
+ &mdash; <div class='inline'>
460
+ <p>Stop scanning after find the first row match.</p>
461
+ </div>
462
+
463
+ </li>
464
+
465
+ <li>
466
+ <span class="name">:regexp_implicit</span>
467
+ <span class="type">(<tt>Boolean</tt>)</span>
468
+ <span class="default">
469
+
470
+ </span>
471
+
472
+ &mdash; <div class='inline'>
473
+ <p>Make regular expressions implicit rather than requiring the comparator =~.
474
+ (Use with care.)</p>
475
+ </div>
476
+
477
+ </li>
478
+
479
+ <li>
480
+ <span class="name">:text_only</span>
481
+ <span class="type">(<tt>Boolean</tt>)</span>
482
+ <span class="default">
483
+
484
+ </span>
485
+
486
+ &mdash; <div class='inline'>
487
+ <p>All cells treated as simple strings by turning off all special matchers.</p>
488
+ </div>
489
+
490
+ </li>
491
+
492
+ <li>
493
+ <span class="name">:matchers</span>
494
+ <span class="type">(<tt>Array&lt;<span class='object_link'><a href="CSVDecision/Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>&gt;</tt>)</span>
495
+ <span class="default">
496
+
497
+ </span>
498
+
499
+ &mdash; <div class='inline'>
500
+ <p>May be used to control the inclusion and ordering of special matchers.
501
+ (Advanced feature, use with care.)</p>
502
+ </div>
503
+
504
+ </li>
505
+
506
+ </ul>
507
+
508
+
509
+ <p class="tag_title">Returns:</p>
510
+ <ul class="return">
511
+
512
+ <li>
513
+
514
+
515
+ <span class='type'>(<tt><span class='object_link'><a href="CSVDecision/Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
516
+
517
+
518
+
519
+ &mdash;
520
+ <div class='inline'>
521
+ <p>Resulting decision table.</p>
522
+ </div>
523
+
524
+ </li>
525
+
526
+ </ul>
527
+ <p class="tag_title">Raises:</p>
528
+ <ul class="raise">
529
+
530
+ <li>
531
+
532
+
533
+ <span class='type'>(<tt><span class='object_link'><a href="CSVDecision/CellValidationError.html" title="CSVDecision::CellValidationError (class)">CSVDecision::CellValidationError</a></span></tt>)</span>
534
+
535
+
536
+
537
+ &mdash;
538
+ <div class='inline'>
539
+ <p>Table parsing cell validation error.</p>
540
+ </div>
541
+
542
+ </li>
543
+
544
+ <li>
545
+
546
+
547
+ <span class='type'>(<tt><span class='object_link'><a href="CSVDecision/FileError.html" title="CSVDecision::FileError (class)">CSVDecision::FileError</a></span></tt>)</span>
548
+
549
+
550
+
551
+ &mdash;
552
+ <div class='inline'>
553
+ <p>Table parsing error for a named CSV file.</p>
554
+ </div>
555
+
556
+ </li>
557
+
558
+ </ul>
559
+
560
+ </div><table class="source_code">
561
+ <tr>
562
+ <td>
563
+ <pre class="lines">
564
+
565
+
566
+ 41
567
+ 42
568
+ 43</pre>
569
+ </td>
570
+ <td>
571
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/parse.rb', line 41</span>
572
+
573
+ <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='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
574
+ <span class='const'><span class='object_link'><a href="CSVDecision/Parse.html" title="CSVDecision::Parse (module)">Parse</a></span></span><span class='period'>.</span><span class='id identifier rubyid_table'><span class='object_link'><a href="CSVDecision/Parse.html#table-class_method" title="CSVDecision::Parse.table (method)">table</a></span></span><span class='lparen'>(</span><span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='const'><span class='object_link'><a href="CSVDecision/Options.html" title="CSVDecision::Options (module)">Options</a></span></span><span class='period'>.</span><span class='id identifier rubyid_normalize'><span class='object_link'><a href="CSVDecision/Options.html#normalize-class_method" title="CSVDecision::Options.normalize (method)">normalize</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
575
+ <span class='kw'>end</span></pre>
576
+ </td>
577
+ </tr>
578
+ </table>
579
+ </div>
580
+
581
+ <div class="method_details ">
582
+ <h3 class="signature " id="root-class_method">
583
+
584
+ .<strong>root</strong> &#x21d2; <tt>String</tt>
585
+
586
+
587
+
588
+
589
+
590
+ </h3><div class="docstring">
591
+ <div class="discussion">
592
+
593
+ <p>Returns gem project&#39;s root directory</p>
594
+
595
+
596
+ </div>
597
+ </div>
598
+ <div class="tags">
599
+
600
+ <p class="tag_title">Returns:</p>
601
+ <ul class="return">
602
+
603
+ <li>
604
+
605
+
606
+ <span class='type'>(<tt>String</tt>)</span>
607
+
608
+
609
+
610
+ &mdash;
611
+ <div class='inline'>
612
+ <p>gem project&#39;s root directory</p>
613
+ </div>
614
+
615
+ </li>
616
+
617
+ </ul>
618
+
619
+ </div><table class="source_code">
620
+ <tr>
621
+ <td>
622
+ <pre class="lines">
623
+
624
+
625
+ 12
626
+ 13
627
+ 14</pre>
628
+ </td>
629
+ <td>
630
+ <pre class="code"><span class="info file"># File 'lib/csv_decision.rb', line 12</span>
631
+
632
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_root'><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span>
633
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span> <span class='id identifier rubyid___dir__'>__dir__</span>
634
+ <span class='kw'>end</span></pre>
635
+ </td>
636
+ </tr>
637
+ </table>
638
+ </div>
639
+
640
+ </div>
641
+
642
+ </div>
643
+
644
+ <div id="footer">
645
+ Generated on Tue Dec 26 18:31:37 2017 by
646
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
647
+ 0.9.12 (ruby-2.3.0).
648
+ </div>
649
+
650
+ </div>
651
+ </body>
652
+ </html>