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