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.
- checksums.yaml +4 -4
- data/.codeclimate.yml +2 -0
- data/.gitignore +2 -1
- data/.travis.yml +2 -3
- data/CHANGELOG.md +19 -1
- data/README.md +49 -16
- data/{benchmark.rb → benchmarks/rufus_decision.rb} +1 -1
- data/csv_decision.gemspec +1 -1
- data/doc/CSVDecision/CellValidationError.html +143 -0
- data/doc/CSVDecision/Columns/Default.html +409 -0
- data/doc/CSVDecision/Columns/Dictionary.html +410 -0
- data/doc/CSVDecision/Columns/Entry.html +321 -0
- data/doc/CSVDecision/Columns.html +476 -0
- data/doc/CSVDecision/Constant.html +295 -0
- data/doc/CSVDecision/Data.html +344 -0
- data/doc/CSVDecision/Decide.html +434 -0
- data/doc/CSVDecision/Decision.html +604 -0
- data/doc/CSVDecision/Error.html +139 -0
- data/doc/CSVDecision/FileError.html +143 -0
- data/doc/CSVDecision/Function.html +229 -0
- data/doc/CSVDecision/Header.html +520 -0
- data/doc/CSVDecision/Input.html +305 -0
- data/doc/CSVDecision/Load.html +225 -0
- data/doc/CSVDecision/Matchers/Constant.html +242 -0
- data/doc/CSVDecision/Matchers/Function.html +342 -0
- data/doc/CSVDecision/Matchers/Matcher.html +325 -0
- data/doc/CSVDecision/Matchers/Numeric.html +277 -0
- data/doc/CSVDecision/Matchers/Pattern.html +600 -0
- data/doc/CSVDecision/Matchers/Range.html +413 -0
- data/doc/CSVDecision/Matchers/Symbol.html +280 -0
- data/doc/CSVDecision/Matchers.html +1529 -0
- data/doc/CSVDecision/Numeric.html +259 -0
- data/doc/CSVDecision/Options.html +445 -0
- data/doc/CSVDecision/Parse.html +270 -0
- data/doc/CSVDecision/ScanRow.html +746 -0
- data/doc/CSVDecision/Symbol.html +256 -0
- data/doc/CSVDecision/Table.html +1115 -0
- data/doc/CSVDecision.html +652 -0
- data/doc/_index.html +410 -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 +264 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +264 -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 +683 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/csv_decision/columns.rb +15 -12
- data/lib/csv_decision/constant.rb +54 -0
- data/lib/csv_decision/decide.rb +5 -5
- data/lib/csv_decision/decision.rb +3 -1
- data/lib/csv_decision/function.rb +32 -0
- data/lib/csv_decision/header.rb +27 -18
- data/lib/csv_decision/input.rb +11 -8
- data/lib/csv_decision/matchers/constant.rb +18 -0
- data/lib/csv_decision/matchers/function.rb +11 -44
- data/lib/csv_decision/matchers/numeric.rb +5 -33
- data/lib/csv_decision/matchers/pattern.rb +26 -11
- data/lib/csv_decision/matchers/range.rb +21 -5
- data/lib/csv_decision/matchers/symbol.rb +20 -0
- data/lib/csv_decision/matchers.rb +85 -20
- data/lib/csv_decision/numeric.rb +38 -0
- data/lib/csv_decision/options.rb +36 -27
- data/lib/csv_decision/parse.rb +46 -39
- data/lib/csv_decision/scan_row.rb +19 -7
- data/lib/csv_decision/symbol.rb +73 -0
- data/lib/csv_decision/table.rb +24 -18
- data/lib/csv_decision.rb +25 -18
- data/spec/csv_decision/columns_spec.rb +1 -1
- data/spec/csv_decision/constant_spec.rb +60 -0
- data/spec/csv_decision/examples_spec.rb +119 -0
- data/spec/csv_decision/matchers/function_spec.rb +48 -28
- data/spec/csv_decision/matchers/numeric_spec.rb +4 -41
- data/spec/csv_decision/matchers/range_spec.rb +31 -61
- data/spec/csv_decision/matchers/symbol_spec.rb +65 -0
- data/spec/csv_decision/options_spec.rb +14 -2
- data/spec/csv_decision/parse_spec.rb +10 -0
- data/spec/csv_decision/table_spec.rb +112 -6
- data/spec/data/valid/simple_constants.csv +3 -3
- metadata +62 -7
- data/spec/csv_decision/simple_example_spec.rb +0 -75
- /data/spec/{csv_decision.rb → csv_decision_spec.rb} +0 -0
|
@@ -0,0 +1,434 @@
|
|
|
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::Decide
|
|
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::Decide";
|
|
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 (D)</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">Decide</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::Decide
|
|
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/decide.rb</dd>
|
|
82
|
+
</dl>
|
|
83
|
+
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<h2>Overview</h2><div class="docstring">
|
|
87
|
+
<div class="discussion">
|
|
88
|
+
|
|
89
|
+
<p>Main module for searching the decision table looking for one or more
|
|
90
|
+
matches</p>
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="tags">
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<h2>
|
|
107
|
+
Class Method Summary
|
|
108
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
109
|
+
</h2>
|
|
110
|
+
|
|
111
|
+
<ul class="summary">
|
|
112
|
+
|
|
113
|
+
<li class="public ">
|
|
114
|
+
<span class="summary_signature">
|
|
115
|
+
|
|
116
|
+
<a href="#decide-class_method" title="decide (class method)">.<strong>decide</strong>(table:, input:, symbolize_keys:) ⇒ Hash </a>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</span>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
<span class="summary_desc"><div class='inline'>
|
|
131
|
+
<p>Main method for making decisions.</p>
|
|
132
|
+
</div></span>
|
|
133
|
+
|
|
134
|
+
</li>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<li class="public ">
|
|
138
|
+
<span class="summary_signature">
|
|
139
|
+
|
|
140
|
+
<a href="#eval_matcher-class_method" title="eval_matcher (class method)">.<strong>eval_matcher</strong>(proc:, value:, hash:) ⇒ Object </a>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</span>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
155
|
+
|
|
156
|
+
</li>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
<li class="public ">
|
|
160
|
+
<span class="summary_signature">
|
|
161
|
+
|
|
162
|
+
<a href="#matches%3F-class_method" title="matches? (class method)">.<strong>matches?</strong>(row:, input:, scan_row:) ⇒ Boolean </a>
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
</span>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
177
|
+
|
|
178
|
+
</li>
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
</ul>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
<div id="class_method_details" class="method_details_list">
|
|
187
|
+
<h2>Class Method Details</h2>
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
<div class="method_details first">
|
|
191
|
+
<h3 class="signature first" id="decide-class_method">
|
|
192
|
+
|
|
193
|
+
.<strong>decide</strong>(table:, input:, symbolize_keys:) ⇒ <tt>Hash</tt>
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
</h3><div class="docstring">
|
|
200
|
+
<div class="discussion">
|
|
201
|
+
|
|
202
|
+
<p>Main method for making decisions.</p>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
<div class="tags">
|
|
208
|
+
<p class="tag_title">Parameters:</p>
|
|
209
|
+
<ul class="param">
|
|
210
|
+
|
|
211
|
+
<li>
|
|
212
|
+
|
|
213
|
+
<span class='name'>table</span>
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
<span class='type'>(<tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
—
|
|
221
|
+
<div class='inline'>
|
|
222
|
+
<p>Decision table.</p>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
</li>
|
|
226
|
+
|
|
227
|
+
<li>
|
|
228
|
+
|
|
229
|
+
<span class='name'>input</span>
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
—
|
|
237
|
+
<div class='inline'>
|
|
238
|
+
<p>Input hash (keys may or may not be symbolized)</p>
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
</li>
|
|
242
|
+
|
|
243
|
+
<li>
|
|
244
|
+
|
|
245
|
+
<span class='name'>symbolize_keys</span>
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
<span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
—
|
|
253
|
+
<div class='inline'>
|
|
254
|
+
<p>Set to false if keys are symbolized and it's OK to mutate the input
|
|
255
|
+
hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
</li>
|
|
259
|
+
|
|
260
|
+
</ul>
|
|
261
|
+
|
|
262
|
+
<p class="tag_title">Returns:</p>
|
|
263
|
+
<ul class="return">
|
|
264
|
+
|
|
265
|
+
<li>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
—
|
|
273
|
+
<div class='inline'>
|
|
274
|
+
<p>Decision result.</p>
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
</li>
|
|
278
|
+
|
|
279
|
+
</ul>
|
|
280
|
+
|
|
281
|
+
</div><table class="source_code">
|
|
282
|
+
<tr>
|
|
283
|
+
<td>
|
|
284
|
+
<pre class="lines">
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
16
|
|
288
|
+
17
|
|
289
|
+
18
|
|
290
|
+
19
|
|
291
|
+
20
|
|
292
|
+
21
|
|
293
|
+
22
|
|
294
|
+
23
|
|
295
|
+
24
|
|
296
|
+
25
|
|
297
|
+
26</pre>
|
|
298
|
+
</td>
|
|
299
|
+
<td>
|
|
300
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/decide.rb', line 16</span>
|
|
301
|
+
|
|
302
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_decide'>decide</span><span class='lparen'>(</span><span class='label'>table:</span><span class='comma'>,</span> <span class='label'>input:</span><span class='comma'>,</span> <span class='label'>symbolize_keys:</span><span class='rparen'>)</span>
|
|
303
|
+
<span class='comment'># Parse and transform the hash supplied as input
|
|
304
|
+
</span> <span class='id identifier rubyid_parsed_input'>parsed_input</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Input.html" title="CSVDecision::Input (module)">Input</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="Input.html#parse-class_method" title="CSVDecision::Input.parse (method)">parse</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'>input:</span> <span class='id identifier rubyid_input'>input</span><span class='comma'>,</span> <span class='label'>symbolize_keys:</span> <span class='id identifier rubyid_symbolize_keys'>symbolize_keys</span><span class='rparen'>)</span>
|
|
305
|
+
|
|
306
|
+
<span class='comment'># The decision object collects the results of the search and
|
|
307
|
+
</span> <span class='comment'># calculates the final result
|
|
308
|
+
</span> <span class='id identifier rubyid_decision'>decision</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Decision.html" title="CSVDecision::Decision (class)">Decision</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Decision.html#initialize-instance_method" title="CSVDecision::Decision#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'>input:</span> <span class='id identifier rubyid_parsed_input'>parsed_input</span><span class='rparen'>)</span>
|
|
309
|
+
|
|
310
|
+
<span class='comment'># table_scan(table: table, input: parsed_input, decision: decision)
|
|
311
|
+
</span> <span class='id identifier rubyid_decision'>decision</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</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'>input:</span> <span class='id identifier rubyid_parsed_input'>parsed_input</span><span class='rparen'>)</span>
|
|
312
|
+
<span class='kw'>end</span></pre>
|
|
313
|
+
</td>
|
|
314
|
+
</tr>
|
|
315
|
+
</table>
|
|
316
|
+
</div>
|
|
317
|
+
|
|
318
|
+
<div class="method_details ">
|
|
319
|
+
<h3 class="signature " id="eval_matcher-class_method">
|
|
320
|
+
|
|
321
|
+
.<strong>eval_matcher</strong>(proc:, value:, hash:) ⇒ <tt>Object</tt>
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
</h3><table class="source_code">
|
|
328
|
+
<tr>
|
|
329
|
+
<td>
|
|
330
|
+
<pre class="lines">
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
37
|
|
334
|
+
38
|
|
335
|
+
39
|
|
336
|
+
40
|
|
337
|
+
41
|
|
338
|
+
42
|
|
339
|
+
43
|
|
340
|
+
44
|
|
341
|
+
45</pre>
|
|
342
|
+
</td>
|
|
343
|
+
<td>
|
|
344
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/decide.rb', line 37</span>
|
|
345
|
+
|
|
346
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_eval_matcher'>eval_matcher</span><span class='lparen'>(</span><span class='label'>proc:</span><span class='comma'>,</span> <span class='label'>value:</span><span class='comma'>,</span> <span class='label'>hash:</span><span class='rparen'>)</span>
|
|
347
|
+
<span class='id identifier rubyid_function'>function</span> <span class='op'>=</span> <span class='id identifier rubyid_proc'>proc</span><span class='period'>.</span><span class='id identifier rubyid_function'>function</span>
|
|
348
|
+
|
|
349
|
+
<span class='comment'># A symbol guard expression just needs to be passed the input hash
|
|
350
|
+
</span> <span class='kw'>return</span> <span class='id identifier rubyid_function'>function</span><span class='lbracket'>[</span><span class='id identifier rubyid_hash'>hash</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_proc'>proc</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:expression</span>
|
|
351
|
+
|
|
352
|
+
<span class='comment'># All other procs can take one or two args
|
|
353
|
+
</span> <span class='id identifier rubyid_function'>function</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span> <span class='op'>==</span> <span class='int'>1</span> <span class='op'>?</span> <span class='id identifier rubyid_function'>function</span><span class='lbracket'>[</span><span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_function'>function</span><span class='lbracket'>[</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='rbracket'>]</span>
|
|
354
|
+
<span class='kw'>end</span></pre>
|
|
355
|
+
</td>
|
|
356
|
+
</tr>
|
|
357
|
+
</table>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<div class="method_details ">
|
|
361
|
+
<h3 class="signature " id="matches?-class_method">
|
|
362
|
+
|
|
363
|
+
.<strong>matches?</strong>(row:, input:, scan_row:) ⇒ <tt>Boolean</tt>
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
</h3><div class="docstring">
|
|
370
|
+
<div class="discussion">
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
</div>
|
|
374
|
+
</div>
|
|
375
|
+
<div class="tags">
|
|
376
|
+
|
|
377
|
+
<p class="tag_title">Returns:</p>
|
|
378
|
+
<ul class="return">
|
|
379
|
+
|
|
380
|
+
<li>
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
</li>
|
|
388
|
+
|
|
389
|
+
</ul>
|
|
390
|
+
|
|
391
|
+
</div><table class="source_code">
|
|
392
|
+
<tr>
|
|
393
|
+
<td>
|
|
394
|
+
<pre class="lines">
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
28
|
|
398
|
+
29
|
|
399
|
+
30
|
|
400
|
+
31
|
|
401
|
+
32
|
|
402
|
+
33
|
|
403
|
+
34
|
|
404
|
+
35</pre>
|
|
405
|
+
</td>
|
|
406
|
+
<td>
|
|
407
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/decide.rb', line 28</span>
|
|
408
|
+
|
|
409
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_matches?'>matches?</span><span class='lparen'>(</span><span class='label'>row:</span><span class='comma'>,</span> <span class='label'>input:</span><span class='comma'>,</span> <span class='label'>scan_row:</span><span class='rparen'>)</span>
|
|
410
|
+
<span class='id identifier rubyid_match'>match</span> <span class='op'>=</span> <span class='id identifier rubyid_scan_row'>scan_row</span><span class='period'>.</span><span class='id identifier rubyid_match_constants?'>match_constants?</span><span class='lparen'>(</span><span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='comma'>,</span> <span class='label'>scan_cols:</span> <span class='id identifier rubyid_input'>input</span><span class='lbracket'>[</span><span class='symbol'>:scan_cols</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
411
|
+
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_match'>match</span>
|
|
412
|
+
|
|
413
|
+
<span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_scan_row'>scan_row</span><span class='period'>.</span><span class='id identifier rubyid_procs'>procs</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
|
414
|
+
|
|
415
|
+
<span class='id identifier rubyid_scan_row'>scan_row</span><span class='period'>.</span><span class='id identifier rubyid_match_procs?'>match_procs?</span><span class='lparen'>(</span><span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='comma'>,</span> <span class='label'>input:</span> <span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
|
|
416
|
+
<span class='kw'>end</span></pre>
|
|
417
|
+
</td>
|
|
418
|
+
</tr>
|
|
419
|
+
</table>
|
|
420
|
+
</div>
|
|
421
|
+
|
|
422
|
+
</div>
|
|
423
|
+
|
|
424
|
+
</div>
|
|
425
|
+
|
|
426
|
+
<div id="footer">
|
|
427
|
+
Generated on Tue Dec 26 18:31:37 2017 by
|
|
428
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
429
|
+
0.9.12 (ruby-2.3.0).
|
|
430
|
+
</div>
|
|
431
|
+
|
|
432
|
+
</div>
|
|
433
|
+
</body>
|
|
434
|
+
</html>
|