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,742 @@
|
|
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::Paths
|
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::Paths";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (P)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Paths</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::Paths
|
63
|
+
|
64
|
+
|
65
|
+
<span class="private note title">Private</span>
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">CSVDecision::Paths</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/paths.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
<p class="note private">
|
105
|
+
<strong>This class is part of a private API.</strong>
|
106
|
+
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
107
|
+
</p>
|
108
|
+
|
109
|
+
<p>Build an index for a decision table with one or more input columns
|
110
|
+
designated as keys</p>
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
<div class="tags">
|
116
|
+
|
117
|
+
|
118
|
+
</div>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
123
|
+
<ul class="summary">
|
124
|
+
|
125
|
+
<li class="public ">
|
126
|
+
<span class="summary_signature">
|
127
|
+
|
128
|
+
<a href="#paths-instance_method" title="#paths (instance method)">#<strong>paths</strong> ⇒ Hash </a>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
</span>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<span class="note title readonly">readonly</span>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<span class="private note title">private</span>
|
145
|
+
|
146
|
+
|
147
|
+
<span class="summary_desc"><div class='inline'>
|
148
|
+
<p>The index hash mapping in input values to one or more data array row
|
149
|
+
indexes.</p>
|
150
|
+
</div></span>
|
151
|
+
|
152
|
+
</li>
|
153
|
+
|
154
|
+
|
155
|
+
</ul>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<h2>
|
162
|
+
Class Method Summary
|
163
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
164
|
+
</h2>
|
165
|
+
|
166
|
+
<ul class="summary">
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="#scan-class_method" title="scan (class method)">.<strong>scan</strong>(table:) ⇒ CSVDecision::Paths </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
<span class="private note title">private</span>
|
183
|
+
|
184
|
+
|
185
|
+
<span class="summary_desc"><div class='inline'>
|
186
|
+
<p>Build the index of paths.</p>
|
187
|
+
</div></span>
|
188
|
+
|
189
|
+
</li>
|
190
|
+
|
191
|
+
|
192
|
+
<li class="public ">
|
193
|
+
<span class="summary_signature">
|
194
|
+
|
195
|
+
<a href="#symbol-class_method" title="symbol (class method)">.<strong>symbol</strong>(value) ⇒ nil, Symbol </a>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
</span>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<span class="private note title">private</span>
|
207
|
+
|
208
|
+
|
209
|
+
<span class="summary_desc"><div class='inline'>
|
210
|
+
<p>Non-empty string converted to a symbol.</p>
|
211
|
+
</div></span>
|
212
|
+
|
213
|
+
</li>
|
214
|
+
|
215
|
+
|
216
|
+
<li class="public ">
|
217
|
+
<span class="summary_signature">
|
218
|
+
|
219
|
+
<a href="#value-class_method" title="value (class method)">.<strong>value</strong>(current_value, index) ⇒ Integer, Array </a>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</span>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
<span class="private note title">private</span>
|
231
|
+
|
232
|
+
|
233
|
+
<span class="summary_desc"><div class='inline'>
|
234
|
+
<p>New path key value.</p>
|
235
|
+
</div></span>
|
236
|
+
|
237
|
+
</li>
|
238
|
+
|
239
|
+
|
240
|
+
</ul>
|
241
|
+
|
242
|
+
<h2>
|
243
|
+
Instance Method Summary
|
244
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
245
|
+
</h2>
|
246
|
+
|
247
|
+
<ul class="summary">
|
248
|
+
|
249
|
+
<li class="public ">
|
250
|
+
<span class="summary_signature">
|
251
|
+
|
252
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(table:, columns:) ⇒ Paths </a>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
</span>
|
257
|
+
|
258
|
+
|
259
|
+
<span class="note title constructor">constructor</span>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
<span class="private note title">private</span>
|
266
|
+
|
267
|
+
|
268
|
+
<span class="summary_desc"><div class='inline'>
|
269
|
+
<p>A new instance of Paths.</p>
|
270
|
+
</div></span>
|
271
|
+
|
272
|
+
</li>
|
273
|
+
|
274
|
+
|
275
|
+
</ul>
|
276
|
+
|
277
|
+
|
278
|
+
<div id="constructor_details" class="method_details_list">
|
279
|
+
<h2>Constructor Details</h2>
|
280
|
+
|
281
|
+
<div class="method_details first">
|
282
|
+
<h3 class="signature first" id="initialize-instance_method">
|
283
|
+
|
284
|
+
#<strong>initialize</strong>(table:, columns:) ⇒ <tt><span class='object_link'><a href="" title="CSVDecision::Paths (class)">Paths</a></span></tt>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
</h3><div class="docstring">
|
291
|
+
<div class="discussion">
|
292
|
+
<p class="note private">
|
293
|
+
<strong>This method is part of a private API.</strong>
|
294
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
295
|
+
</p>
|
296
|
+
|
297
|
+
<p>Returns a new instance of Paths</p>
|
298
|
+
|
299
|
+
|
300
|
+
</div>
|
301
|
+
</div>
|
302
|
+
<div class="tags">
|
303
|
+
<p class="tag_title">Parameters:</p>
|
304
|
+
<ul class="param">
|
305
|
+
|
306
|
+
<li>
|
307
|
+
|
308
|
+
<span class='name'>table</span>
|
309
|
+
|
310
|
+
|
311
|
+
<span class='type'>(<tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
—
|
316
|
+
<div class='inline'>
|
317
|
+
<p>Decision table.</p>
|
318
|
+
</div>
|
319
|
+
|
320
|
+
</li>
|
321
|
+
|
322
|
+
<li>
|
323
|
+
|
324
|
+
<span class='name'>columns</span>
|
325
|
+
|
326
|
+
|
327
|
+
<span class='type'>(<tt>Array<<span class='object_link'><a href="Index.html" title="CSVDecision::Index (class)">Index</a></span>></tt>)</span>
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
—
|
332
|
+
<div class='inline'>
|
333
|
+
<p>Array of column indexes to be indexed.</p>
|
334
|
+
</div>
|
335
|
+
|
336
|
+
</li>
|
337
|
+
|
338
|
+
</ul>
|
339
|
+
|
340
|
+
|
341
|
+
</div><table class="source_code">
|
342
|
+
<tr>
|
343
|
+
<td>
|
344
|
+
<pre class="lines">
|
345
|
+
|
346
|
+
|
347
|
+
45
|
348
|
+
46
|
349
|
+
47
|
350
|
+
48
|
351
|
+
49
|
352
|
+
50
|
353
|
+
51
|
354
|
+
52</pre>
|
355
|
+
</td>
|
356
|
+
<td>
|
357
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/paths.rb', line 45</span>
|
358
|
+
|
359
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>table:</span><span class='comma'>,</span> <span class='label'>columns:</span><span class='rparen'>)</span>
|
360
|
+
<span class='ivar'>@paths</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
361
|
+
<span class='ivar'>@columns</span> <span class='op'>=</span> <span class='id identifier rubyid_columns'>columns</span>
|
362
|
+
|
363
|
+
<span class='id identifier rubyid_build'>build</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='rparen'>)</span>
|
364
|
+
|
365
|
+
<span class='id identifier rubyid_freeze'>freeze</span>
|
366
|
+
<span class='kw'>end</span></pre>
|
367
|
+
</td>
|
368
|
+
</tr>
|
369
|
+
</table>
|
370
|
+
</div>
|
371
|
+
|
372
|
+
</div>
|
373
|
+
|
374
|
+
<div id="instance_attr_details" class="attr_details">
|
375
|
+
<h2>Instance Attribute Details</h2>
|
376
|
+
|
377
|
+
|
378
|
+
<span id=""></span>
|
379
|
+
<div class="method_details first">
|
380
|
+
<h3 class="signature first" id="paths-instance_method">
|
381
|
+
|
382
|
+
#<strong>paths</strong> ⇒ <tt>Hash</tt> <span class="extras">(readonly)</span>
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
</h3><div class="docstring">
|
389
|
+
<div class="discussion">
|
390
|
+
<p class="note private">
|
391
|
+
<strong>This method is part of a private API.</strong>
|
392
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
393
|
+
</p>
|
394
|
+
|
395
|
+
<p>Returns The index hash mapping in input values to one or more data array
|
396
|
+
row indexes.</p>
|
397
|
+
|
398
|
+
|
399
|
+
</div>
|
400
|
+
</div>
|
401
|
+
<div class="tags">
|
402
|
+
|
403
|
+
<p class="tag_title">Returns:</p>
|
404
|
+
<ul class="return">
|
405
|
+
|
406
|
+
<li>
|
407
|
+
|
408
|
+
|
409
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
—
|
414
|
+
<div class='inline'>
|
415
|
+
<p>The index hash mapping in input values to one or more data array row
|
416
|
+
indexes.</p>
|
417
|
+
</div>
|
418
|
+
|
419
|
+
</li>
|
420
|
+
|
421
|
+
</ul>
|
422
|
+
|
423
|
+
</div><table class="source_code">
|
424
|
+
<tr>
|
425
|
+
<td>
|
426
|
+
<pre class="lines">
|
427
|
+
|
428
|
+
|
429
|
+
41
|
430
|
+
42
|
431
|
+
43</pre>
|
432
|
+
</td>
|
433
|
+
<td>
|
434
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/paths.rb', line 41</span>
|
435
|
+
|
436
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_paths'>paths</span>
|
437
|
+
<span class='ivar'>@paths</span>
|
438
|
+
<span class='kw'>end</span></pre>
|
439
|
+
</td>
|
440
|
+
</tr>
|
441
|
+
</table>
|
442
|
+
</div>
|
443
|
+
|
444
|
+
</div>
|
445
|
+
|
446
|
+
|
447
|
+
<div id="class_method_details" class="method_details_list">
|
448
|
+
<h2>Class Method Details</h2>
|
449
|
+
|
450
|
+
|
451
|
+
<div class="method_details first">
|
452
|
+
<h3 class="signature first" id="scan-class_method">
|
453
|
+
|
454
|
+
.<strong>scan</strong>(table:) ⇒ <tt><span class='object_link'><a href="" title="CSVDecision::Paths (class)">CSVDecision::Paths</a></span></tt>
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
</h3><div class="docstring">
|
461
|
+
<div class="discussion">
|
462
|
+
<p class="note private">
|
463
|
+
<strong>This method is part of a private API.</strong>
|
464
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
465
|
+
</p>
|
466
|
+
|
467
|
+
<p>Build the index of paths</p>
|
468
|
+
|
469
|
+
|
470
|
+
</div>
|
471
|
+
</div>
|
472
|
+
<div class="tags">
|
473
|
+
<p class="tag_title">Parameters:</p>
|
474
|
+
<ul class="param">
|
475
|
+
|
476
|
+
<li>
|
477
|
+
|
478
|
+
<span class='name'>table</span>
|
479
|
+
|
480
|
+
|
481
|
+
<span class='type'>(<tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
—
|
486
|
+
<div class='inline'>
|
487
|
+
<p>Decision table being indexed.</p>
|
488
|
+
</div>
|
489
|
+
|
490
|
+
</li>
|
491
|
+
|
492
|
+
</ul>
|
493
|
+
|
494
|
+
<p class="tag_title">Returns:</p>
|
495
|
+
<ul class="return">
|
496
|
+
|
497
|
+
<li>
|
498
|
+
|
499
|
+
|
500
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="CSVDecision::Paths (class)">CSVDecision::Paths</a></span></tt>)</span>
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
—
|
505
|
+
<div class='inline'>
|
506
|
+
<p>The built index of paths.</p>
|
507
|
+
</div>
|
508
|
+
|
509
|
+
</li>
|
510
|
+
|
511
|
+
</ul>
|
512
|
+
|
513
|
+
</div><table class="source_code">
|
514
|
+
<tr>
|
515
|
+
<td>
|
516
|
+
<pre class="lines">
|
517
|
+
|
518
|
+
|
519
|
+
16
|
520
|
+
17
|
521
|
+
18
|
522
|
+
19
|
523
|
+
20
|
524
|
+
21
|
525
|
+
22</pre>
|
526
|
+
</td>
|
527
|
+
<td>
|
528
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/paths.rb', line 16</span>
|
529
|
+
|
530
|
+
<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'>table:</span><span class='rparen'>)</span>
|
531
|
+
<span class='comment'># Do we even have paths?
|
532
|
+
</span> <span class='id identifier rubyid_columns'>columns</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
533
|
+
<span class='kw'>return</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
534
|
+
|
535
|
+
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="CSVDecision::Paths (class)">Paths</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="CSVDecision::Paths#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>table:</span> <span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='label'>columns:</span> <span class='id identifier rubyid_columns'>columns</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_paths'><span class='object_link'><a href="#paths-instance_method" title="CSVDecision::Paths#paths (method)">paths</a></span></span>
|
536
|
+
<span class='kw'>end</span></pre>
|
537
|
+
</td>
|
538
|
+
</tr>
|
539
|
+
</table>
|
540
|
+
</div>
|
541
|
+
|
542
|
+
<div class="method_details ">
|
543
|
+
<h3 class="signature " id="symbol-class_method">
|
544
|
+
|
545
|
+
.<strong>symbol</strong>(value) ⇒ <tt>nil</tt>, <tt>Symbol</tt>
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
</h3><div class="docstring">
|
552
|
+
<div class="discussion">
|
553
|
+
<p class="note private">
|
554
|
+
<strong>This method is part of a private API.</strong>
|
555
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
556
|
+
</p>
|
557
|
+
|
558
|
+
<p>Returns Non-empty string converted to a symbol.</p>
|
559
|
+
|
560
|
+
|
561
|
+
</div>
|
562
|
+
</div>
|
563
|
+
<div class="tags">
|
564
|
+
<p class="tag_title">Parameters:</p>
|
565
|
+
<ul class="param">
|
566
|
+
|
567
|
+
<li>
|
568
|
+
|
569
|
+
<span class='name'>value</span>
|
570
|
+
|
571
|
+
|
572
|
+
<span class='type'>(<tt>String</tt>)</span>
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
—
|
577
|
+
<div class='inline'>
|
578
|
+
<p>Cell value for the path: column.</p>
|
579
|
+
</div>
|
580
|
+
|
581
|
+
</li>
|
582
|
+
|
583
|
+
</ul>
|
584
|
+
|
585
|
+
<p class="tag_title">Returns:</p>
|
586
|
+
<ul class="return">
|
587
|
+
|
588
|
+
<li>
|
589
|
+
|
590
|
+
|
591
|
+
<span class='type'>(<tt>nil</tt>, <tt>Symbol</tt>)</span>
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
—
|
596
|
+
<div class='inline'>
|
597
|
+
<p>Non-empty string converted to a symbol.</p>
|
598
|
+
</div>
|
599
|
+
|
600
|
+
</li>
|
601
|
+
|
602
|
+
</ul>
|
603
|
+
|
604
|
+
</div><table class="source_code">
|
605
|
+
<tr>
|
606
|
+
<td>
|
607
|
+
<pre class="lines">
|
608
|
+
|
609
|
+
|
610
|
+
36
|
611
|
+
37
|
612
|
+
38</pre>
|
613
|
+
</td>
|
614
|
+
<td>
|
615
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/paths.rb', line 36</span>
|
616
|
+
|
617
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_symbol'>symbol</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
618
|
+
<span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='op'>?</span> <span class='kw'>nil</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
619
|
+
<span class='kw'>end</span></pre>
|
620
|
+
</td>
|
621
|
+
</tr>
|
622
|
+
</table>
|
623
|
+
</div>
|
624
|
+
|
625
|
+
<div class="method_details ">
|
626
|
+
<h3 class="signature " id="value-class_method">
|
627
|
+
|
628
|
+
.<strong>value</strong>(current_value, index) ⇒ <tt>Integer</tt>, <tt>Array</tt>
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
|
634
|
+
</h3><div class="docstring">
|
635
|
+
<div class="discussion">
|
636
|
+
<p class="note private">
|
637
|
+
<strong>This method is part of a private API.</strong>
|
638
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
639
|
+
</p>
|
640
|
+
|
641
|
+
<p>Returns New path key value.</p>
|
642
|
+
|
643
|
+
|
644
|
+
</div>
|
645
|
+
</div>
|
646
|
+
<div class="tags">
|
647
|
+
<p class="tag_title">Parameters:</p>
|
648
|
+
<ul class="param">
|
649
|
+
|
650
|
+
<li>
|
651
|
+
|
652
|
+
<span class='name'>current_value</span>
|
653
|
+
|
654
|
+
|
655
|
+
<span class='type'>(<tt>Integer</tt>, <tt>Array</tt>)</span>
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
—
|
660
|
+
<div class='inline'>
|
661
|
+
<p>Current path value.</p>
|
662
|
+
</div>
|
663
|
+
|
664
|
+
</li>
|
665
|
+
|
666
|
+
<li>
|
667
|
+
|
668
|
+
<span class='name'>index</span>
|
669
|
+
|
670
|
+
|
671
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
—
|
676
|
+
<div class='inline'>
|
677
|
+
<p>Array row index to be included in the path entry.</p>
|
678
|
+
</div>
|
679
|
+
|
680
|
+
</li>
|
681
|
+
|
682
|
+
</ul>
|
683
|
+
|
684
|
+
<p class="tag_title">Returns:</p>
|
685
|
+
<ul class="return">
|
686
|
+
|
687
|
+
<li>
|
688
|
+
|
689
|
+
|
690
|
+
<span class='type'>(<tt>Integer</tt>, <tt>Array</tt>)</span>
|
691
|
+
|
692
|
+
|
693
|
+
|
694
|
+
—
|
695
|
+
<div class='inline'>
|
696
|
+
<p>New path key value.</p>
|
697
|
+
</div>
|
698
|
+
|
699
|
+
</li>
|
700
|
+
|
701
|
+
</ul>
|
702
|
+
|
703
|
+
</div><table class="source_code">
|
704
|
+
<tr>
|
705
|
+
<td>
|
706
|
+
<pre class="lines">
|
707
|
+
|
708
|
+
|
709
|
+
27
|
710
|
+
28
|
711
|
+
29
|
712
|
+
30
|
713
|
+
31
|
714
|
+
32</pre>
|
715
|
+
</td>
|
716
|
+
<td>
|
717
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/paths.rb', line 27</span>
|
718
|
+
|
719
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='lparen'>(</span><span class='id identifier rubyid_current_value'>current_value</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span>
|
720
|
+
<span class='kw'>return</span> <span class='lbracket'>[</span><span class='id identifier rubyid_current_value'>current_value</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_current_value'>current_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>
|
721
|
+
|
722
|
+
<span class='id identifier rubyid_current_value'>current_value</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_index'>index</span>
|
723
|
+
<span class='id identifier rubyid_current_value'>current_value</span>
|
724
|
+
<span class='kw'>end</span></pre>
|
725
|
+
</td>
|
726
|
+
</tr>
|
727
|
+
</table>
|
728
|
+
</div>
|
729
|
+
|
730
|
+
</div>
|
731
|
+
|
732
|
+
</div>
|
733
|
+
|
734
|
+
<div id="footer">
|
735
|
+
Generated on Sun Feb 11 10:26:08 2018 by
|
736
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
737
|
+
0.9.12 (ruby-2.4.0).
|
738
|
+
</div>
|
739
|
+
|
740
|
+
</div>
|
741
|
+
</body>
|
742
|
+
</html>
|