csv_decision2 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/README.md +16 -16
- data/benchmarks/rufus_decision.rb +5 -7
- data/csv_decision2.gemspec +2 -2
- data/doc/CSVDecision/CellValidationError.html +117 -110
- data/doc/CSVDecision/Columns/Default.html +537 -508
- data/doc/CSVDecision/Columns/Dictionary.html +729 -686
- data/doc/CSVDecision/Columns/Entry.html +457 -433
- data/doc/CSVDecision/Columns.html +1134 -1051
- data/doc/CSVDecision/Constant.html +205 -191
- data/doc/CSVDecision/Data.html +423 -398
- data/doc/CSVDecision/Decide.html +236 -225
- data/doc/CSVDecision/Decision.html +872 -825
- data/doc/CSVDecision/Defaults.html +243 -230
- data/doc/CSVDecision/Dictionary/Entry.html +1026 -964
- data/doc/CSVDecision/Dictionary.html +377 -355
- data/doc/CSVDecision/Error.html +116 -105
- data/doc/CSVDecision/FileError.html +117 -110
- data/doc/CSVDecision/Function.html +181 -168
- data/doc/CSVDecision/Guard.html +200 -185
- data/doc/CSVDecision/Header.html +557 -523
- data/doc/CSVDecision/Index.html +652 -617
- data/doc/CSVDecision/Input.html +329 -312
- data/doc/CSVDecision/Load.html +232 -220
- data/doc/CSVDecision/Matchers/Constant.html +432 -399
- data/doc/CSVDecision/Matchers/Function.html +451 -415
- data/doc/CSVDecision/Matchers/Guard.html +459 -424
- data/doc/CSVDecision/Matchers/Matcher.html +470 -426
- data/doc/CSVDecision/Matchers/Numeric.html +375 -346
- data/doc/CSVDecision/Matchers/Pattern.html +429 -396
- data/doc/CSVDecision/Matchers/Proc.html +617 -575
- data/doc/CSVDecision/Matchers/Range.html +331 -302
- data/doc/CSVDecision/Matchers/Symbol.html +386 -353
- data/doc/CSVDecision/Matchers.html +1509 -1393
- data/doc/CSVDecision/Numeric.html +201 -188
- data/doc/CSVDecision/Options.html +376 -357
- data/doc/CSVDecision/Parse.html +217 -204
- data/doc/CSVDecision/Paths.html +664 -629
- data/doc/CSVDecision/Result.html +1076 -1005
- data/doc/CSVDecision/Scan/InputHashes.html +305 -288
- data/doc/CSVDecision/Scan.html +262 -249
- data/doc/CSVDecision/ScanRow.html +749 -705
- data/doc/CSVDecision/Symbol.html +204 -191
- data/doc/CSVDecision/Table.html +1391 -1305
- data/doc/CSVDecision/TableValidationError.html +117 -110
- data/doc/CSVDecision/Validate.html +353 -337
- data/doc/CSVDecision.html +623 -552
- data/doc/_index.html +488 -448
- data/doc/class_list.html +250 -45
- data/doc/file.README.html +304 -278
- data/doc/index.html +304 -278
- data/doc/method_list.html +1159 -1017
- data/doc/top-level-namespace.html +79 -75
- data/lib/{csv_decision → csv_decision2}/columns.rb +7 -7
- data/lib/{csv_decision → csv_decision2}/data.rb +1 -1
- data/lib/{csv_decision → csv_decision2}/decision.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/defaults.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/dictionary.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/header.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/index.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/input.rb +3 -3
- data/lib/{csv_decision → csv_decision2}/load.rb +6 -6
- data/lib/{csv_decision → csv_decision2}/matchers/constant.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/function.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/guard.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/numeric.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/pattern.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/range.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/symbol.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/options.rb +3 -3
- data/lib/{csv_decision → csv_decision2}/parse.rb +14 -14
- data/lib/{csv_decision → csv_decision2}/paths.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/result.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/scan.rb +3 -3
- data/lib/{csv_decision → csv_decision2}/scan_row.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/table.rb +8 -8
- data/lib/{csv_decision → csv_decision2}/validate.rb +2 -2
- data/lib/csv_decision2.rb +45 -0
- data/spec/{csv_decision → csv_decision2}/columns_spec.rb +44 -44
- data/spec/{csv_decision → csv_decision2}/constant_spec.rb +4 -4
- data/spec/{csv_decision → csv_decision2}/data_spec.rb +11 -11
- data/spec/{csv_decision → csv_decision2}/decision_spec.rb +6 -6
- data/spec/{csv_decision → csv_decision2}/examples_spec.rb +14 -14
- data/spec/{csv_decision → csv_decision2}/index_spec.rb +8 -8
- data/spec/{csv_decision → csv_decision2}/input_spec.rb +9 -9
- data/spec/{csv_decision → csv_decision2}/load_spec.rb +8 -8
- data/spec/{csv_decision → csv_decision2}/matchers/function_spec.rb +7 -7
- data/spec/{csv_decision → csv_decision2}/matchers/guard_spec.rb +14 -14
- data/spec/{csv_decision → csv_decision2}/matchers/numeric_spec.rb +5 -5
- data/spec/{csv_decision → csv_decision2}/matchers/pattern_spec.rb +6 -6
- data/spec/{csv_decision → csv_decision2}/matchers/range_spec.rb +5 -5
- data/spec/{csv_decision → csv_decision2}/matchers/symbol_spec.rb +6 -6
- data/spec/{csv_decision → csv_decision2}/options_spec.rb +18 -18
- data/spec/csv_decision2/parse_spec.rb +44 -0
- data/spec/{csv_decision → csv_decision2}/table_spec.rb +17 -17
- data/spec/csv_decision2_spec.rb +7 -0
- metadata +64 -64
- data/lib/csv_decision.rb +0 -45
- data/spec/csv_decision/parse_spec.rb +0 -44
- data/spec/csv_decision_spec.rb +0 -7
@@ -1,23 +1,24 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
|
4
|
-
|
5
|
-
<meta
|
6
|
-
<
|
7
|
-
|
8
|
-
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7
|
+
<title>
|
8
|
+
Class: CSVDecision2::Decision
|
9
|
+
|
9
10
|
— Documentation by YARD 0.9.12
|
10
|
-
|
11
|
-
</title>
|
11
|
+
|
12
|
+
</title>
|
12
13
|
|
13
14
|
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
15
|
|
15
16
|
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
17
|
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
|
19
|
-
|
20
|
-
</script>
|
18
|
+
<script type="text/javascript" charset="utf-8">
|
19
|
+
pathId = "CSVDecision2::Decision";
|
20
|
+
relpath = '../';
|
21
|
+
</script>
|
21
22
|
|
22
23
|
|
23
24
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
@@ -25,353 +26,383 @@
|
|
25
26
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
27
|
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
</head>
|
30
|
+
|
31
|
+
<body>
|
32
|
+
<div class="nav_wrap">
|
33
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
34
|
+
<div id="resizer"></div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="main" tabindex="-1">
|
38
|
+
<div id="header">
|
39
|
+
<div id="menu">
|
40
|
+
|
41
|
+
<a href="../_index.html">Index (D)</a> »
|
42
|
+
<span class='title'><span class='object_link'><a href="../CSVDecision2.html"
|
43
|
+
title="CSVDecision (module)">CSVDecision</a></span></span>
|
44
|
+
»
|
45
|
+
<span class="title">Decision</span>
|
46
|
+
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<div id="search">
|
50
|
+
|
51
|
+
<a class="full_list_link" id="class_list_link" href="../class_list.html">
|
52
|
+
|
53
|
+
<svg width="24" height="24">
|
54
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
56
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
57
|
+
</svg>
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
33
62
|
</div>
|
34
63
|
|
35
|
-
<div id="
|
36
|
-
<
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
64
|
+
<div id="content">
|
65
|
+
<h1>Class: CSVDecision2::Decision
|
66
|
+
|
67
|
+
|
68
|
+
<span class="private note title">Private</span>
|
69
|
+
</h1>
|
70
|
+
<div class="box_info">
|
71
|
+
|
72
|
+
<dl>
|
73
|
+
<dt>Inherits:</dt>
|
74
|
+
<dd>
|
75
|
+
<span class="inheritName">Object</span>
|
76
|
+
|
77
|
+
<ul class="fullTree">
|
78
|
+
<li>Object</li>
|
79
|
+
|
80
|
+
<li class="next">CSVDecision2::Decision</li>
|
81
|
+
|
82
|
+
</ul>
|
83
|
+
<a href="#" class="inheritanceTree">show all</a>
|
84
|
+
|
85
|
+
</dd>
|
86
|
+
</dl>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dl>
|
99
|
+
<dt>Defined in:</dt>
|
100
|
+
<dd>lib/csv_decision2/decision.rb</dd>
|
101
|
+
</dl>
|
102
|
+
|
60
103
|
</div>
|
61
104
|
|
62
|
-
<
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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::Decision</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/decision.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>Accumulate the matching row(s) and calculate the final result.</p>
|
105
|
+
<h2>Overview</h2>
|
106
|
+
<div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
<p class="note private">
|
109
|
+
<strong>This class is part of a private API.</strong>
|
110
|
+
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
111
|
+
</p>
|
110
112
|
|
113
|
+
<p>Accumulate the matching row(s) and calculate the final result.</p>
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
<div class="tags">
|
119
|
+
|
120
|
+
|
121
|
+
</div>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
126
|
+
<ul class="summary">
|
111
127
|
|
112
|
-
</div>
|
113
|
-
</div>
|
114
|
-
<div class="tags">
|
115
|
-
|
116
|
-
|
117
|
-
</div>
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
122
|
-
<ul class="summary">
|
123
|
-
|
124
|
-
<li class="public ">
|
125
|
-
<span class="summary_signature">
|
126
|
-
|
127
|
-
<a href="#first_match-instance_method" title="#first_match (instance method)">#<strong>first_match</strong> ⇒ Boolean </a>
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
</span>
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
<span class="note title readonly">readonly</span>
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
<span class="private note title">private</span>
|
144
|
-
|
145
|
-
|
146
|
-
<span class="summary_desc"><div class='inline'>
|
147
|
-
<p>True if a first match decision table.</p>
|
148
|
-
</div></span>
|
149
|
-
|
150
|
-
</li>
|
151
|
-
|
152
|
-
|
153
|
-
</ul>
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
<h2>
|
160
|
-
Class Method Summary
|
161
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
162
|
-
</h2>
|
163
|
-
|
164
|
-
<ul class="summary">
|
165
|
-
|
166
128
|
<li class="public ">
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
129
|
+
<span class="summary_signature">
|
130
|
+
|
131
|
+
<a href="#first_match-instance_method" title="#first_match (instance method)">#<strong>first_match</strong>
|
132
|
+
⇒ Boolean </a>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
</span>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
<span class="note title readonly">readonly</span>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<span class="private note title">private</span>
|
149
|
+
|
150
|
+
|
151
|
+
<span class="summary_desc">
|
152
|
+
<div class='inline'>
|
153
|
+
<p>True if a first match decision table.</p>
|
154
|
+
</div>
|
155
|
+
</span>
|
156
|
+
|
157
|
+
</li>
|
158
|
+
|
159
|
+
|
160
|
+
</ul>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<h2>
|
167
|
+
Class Method Summary
|
168
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
169
|
+
</h2>
|
170
|
+
|
171
|
+
<ul class="summary">
|
172
|
+
|
199
173
|
<li class="public ">
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
<
|
218
|
-
|
219
|
-
|
220
|
-
</
|
221
|
-
|
222
|
-
|
174
|
+
<span class="summary_signature">
|
175
|
+
|
176
|
+
<a href="#make-class_method" title="make (class method)">.<strong>make</strong>(table:, input:,
|
177
|
+
symbolize_keys:) ⇒ Hash{Symbol=>Object} </a>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
</span>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<span class="private note title">private</span>
|
189
|
+
|
190
|
+
|
191
|
+
<span class="summary_desc">
|
192
|
+
<div class='inline'>
|
193
|
+
<p>Main method for making decisions without a path.</p>
|
194
|
+
</div>
|
195
|
+
</span>
|
196
|
+
|
197
|
+
</li>
|
198
|
+
|
199
|
+
|
200
|
+
</ul>
|
201
|
+
|
202
|
+
<h2>
|
203
|
+
Instance Method Summary
|
204
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
205
|
+
</h2>
|
206
|
+
|
207
|
+
<ul class="summary">
|
208
|
+
|
223
209
|
<li class="public ">
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
210
|
+
<span class="summary_signature">
|
211
|
+
|
212
|
+
<a href="#index_scan_accumulate-instance_method"
|
213
|
+
title="#index_scan_accumulate (instance method)">#<strong>index_scan_accumulate</strong>(scan_cols:,
|
214
|
+
hash:, index_rows:) ⇒ Hash{Symbol=>Object} </a>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
</span>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<span class="private note title">private</span>
|
226
|
+
|
227
|
+
|
228
|
+
<span class="summary_desc">
|
229
|
+
<div class='inline'>
|
230
|
+
<p>Scan the index for an accumulated result.</p>
|
231
|
+
</div>
|
232
|
+
</span>
|
233
|
+
|
234
|
+
</li>
|
235
|
+
|
236
|
+
|
247
237
|
<li class="public ">
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
<
|
268
|
-
|
269
|
-
|
270
|
-
</
|
271
|
-
|
272
|
-
|
238
|
+
<span class="summary_signature">
|
239
|
+
|
240
|
+
<a href="#index_scan_first_match-instance_method"
|
241
|
+
title="#index_scan_first_match (instance method)">#<strong>index_scan_first_match</strong>(scan_cols:,
|
242
|
+
hash:, index_rows:) ⇒ Hash{Symbol=>Object} </a>
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
</span>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
<span class="private note title">private</span>
|
254
|
+
|
255
|
+
|
256
|
+
<span class="summary_desc">
|
257
|
+
<div class='inline'>
|
258
|
+
<p>Scan the index for a first match result.</p>
|
259
|
+
</div>
|
260
|
+
</span>
|
261
|
+
|
262
|
+
</li>
|
263
|
+
|
264
|
+
|
273
265
|
<li class="public ">
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
266
|
+
<span class="summary_signature">
|
267
|
+
|
268
|
+
<a href="#initialize-instance_method"
|
269
|
+
title="#initialize (instance method)">#<strong>initialize</strong>(table:) ⇒ Decision </a>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
</span>
|
274
|
+
|
275
|
+
|
276
|
+
<span class="note title constructor">constructor</span>
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
<span class="private note title">private</span>
|
283
|
+
|
284
|
+
|
285
|
+
<span class="summary_desc">
|
286
|
+
<div class='inline'>
|
287
|
+
<p>A new instance of Decision.</p>
|
288
|
+
</div>
|
289
|
+
</span>
|
290
|
+
|
291
|
+
</li>
|
292
|
+
|
293
|
+
|
297
294
|
<li class="public ">
|
298
|
-
|
299
|
-
|
300
|
-
<a href="#scan-instance_method" title="#scan (instance method)">#<strong>scan</strong>(data) ⇒ Hash{Symbol=>Object} </a>
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
</span>
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
<span class="private note title">private</span>
|
312
|
-
|
313
|
-
|
314
|
-
<span class="summary_desc"><div class='inline'>
|
315
|
-
<p>Scan the decision table and produce an output decision.</p>
|
316
|
-
</div></span>
|
317
|
-
|
318
|
-
</li>
|
319
|
-
|
320
|
-
|
321
|
-
</ul>
|
322
|
-
|
323
|
-
|
324
|
-
<div id="constructor_details" class="method_details_list">
|
325
|
-
<h2>Constructor Details</h2>
|
326
|
-
|
327
|
-
<div class="method_details first">
|
328
|
-
<h3 class="signature first" id="initialize-instance_method">
|
329
|
-
|
330
|
-
#<strong>initialize</strong>(table:) ⇒ <tt><span class='object_link'><a href="" title="CSVDecision::Decision (class)">Decision</a></span></tt>
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
</h3><div class="docstring">
|
337
|
-
<div class="discussion">
|
338
|
-
<p class="note private">
|
339
|
-
<strong>This method is part of a private API.</strong>
|
340
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
341
|
-
</p>
|
342
|
-
|
343
|
-
<p>Returns a new instance of Decision</p>
|
295
|
+
<span class="summary_signature">
|
344
296
|
|
297
|
+
<a href="#input-instance_method" title="#input (instance method)">#<strong>input</strong>(data) ⇒
|
298
|
+
void </a>
|
345
299
|
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
</
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
</
|
372
|
-
|
373
|
-
|
374
|
-
|
300
|
+
|
301
|
+
|
302
|
+
</span>
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
<span class="private note title">private</span>
|
310
|
+
|
311
|
+
|
312
|
+
<span class="summary_desc">
|
313
|
+
<div class='inline'>
|
314
|
+
<p>Initialize the input data used to make the decision.</p>
|
315
|
+
</div>
|
316
|
+
</span>
|
317
|
+
|
318
|
+
</li>
|
319
|
+
|
320
|
+
|
321
|
+
<li class="public ">
|
322
|
+
<span class="summary_signature">
|
323
|
+
|
324
|
+
<a href="#scan-instance_method" title="#scan (instance method)">#<strong>scan</strong>(data) ⇒
|
325
|
+
Hash{Symbol=>Object} </a>
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</span>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
<span class="private note title">private</span>
|
337
|
+
|
338
|
+
|
339
|
+
<span class="summary_desc">
|
340
|
+
<div class='inline'>
|
341
|
+
<p>Scan the decision table and produce an output decision.</p>
|
342
|
+
</div>
|
343
|
+
</span>
|
344
|
+
|
345
|
+
</li>
|
346
|
+
|
347
|
+
|
348
|
+
</ul>
|
349
|
+
|
350
|
+
|
351
|
+
<div id="constructor_details" class="method_details_list">
|
352
|
+
<h2>Constructor Details</h2>
|
353
|
+
|
354
|
+
<div class="method_details first">
|
355
|
+
<h3 class="signature first" id="initialize-instance_method">
|
356
|
+
|
357
|
+
#<strong>initialize</strong>(table:) ⇒ <tt><span class='object_link'><a href=""
|
358
|
+
title="CSVDecision2::Decision (class)">Decision</a></span></tt>
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
</h3>
|
365
|
+
<div class="docstring">
|
366
|
+
<div class="discussion">
|
367
|
+
<p class="note private">
|
368
|
+
<strong>This method is part of a private API.</strong>
|
369
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
370
|
+
</p>
|
371
|
+
|
372
|
+
<p>Returns a new instance of Decision</p>
|
373
|
+
|
374
|
+
|
375
|
+
</div>
|
376
|
+
</div>
|
377
|
+
<div class="tags">
|
378
|
+
<p class="tag_title">Parameters:</p>
|
379
|
+
<ul class="param">
|
380
|
+
|
381
|
+
<li>
|
382
|
+
|
383
|
+
<span class='name'>table</span>
|
384
|
+
|
385
|
+
|
386
|
+
<span class='type'>(<tt><span class='object_link'><a href="Table.html"
|
387
|
+
title="CSVDecision2::Table (class)">CSVDecision2::Table</a></span></tt>)</span>
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
—
|
392
|
+
<div class='inline'>
|
393
|
+
<p>Decision table being processed.</p>
|
394
|
+
</div>
|
395
|
+
|
396
|
+
</li>
|
397
|
+
|
398
|
+
</ul>
|
399
|
+
|
400
|
+
|
401
|
+
</div>
|
402
|
+
<table class="source_code">
|
403
|
+
<tr>
|
404
|
+
<td>
|
405
|
+
<pre class="lines">
|
375
406
|
|
376
407
|
|
377
408
|
31
|
@@ -381,198 +412,203 @@
|
|
381
412
|
35
|
382
413
|
36
|
383
414
|
37</pre>
|
384
|
-
|
385
|
-
|
386
|
-
|
415
|
+
</td>
|
416
|
+
<td>
|
417
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/decision.rb', line 31</span>
|
387
418
|
|
388
419
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>table:</span><span class='rparen'>)</span>
|
389
420
|
<span class='comment'># The result object is a hash of values, and each value will be an array if this is
|
390
421
|
</span> <span class='comment'># a multi-row result for the +first_match: false+ option.
|
391
|
-
</span> <span class='ivar'>@result</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Result.html" title="
|
422
|
+
</span> <span class='ivar'>@result</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Result.html" title="CSVDecision2::Result (class)">Result</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result.html#initialize-instance_method" title="CSVDecision2::Result#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='rparen'>)</span>
|
392
423
|
<span class='ivar'>@first_match</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:first_match</span><span class='rbracket'>]</span>
|
393
424
|
<span class='ivar'>@table</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span>
|
394
425
|
<span class='kw'>end</span></pre>
|
395
|
-
|
396
|
-
|
397
|
-
</table>
|
398
|
-
</div>
|
399
|
-
|
400
|
-
</div>
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
</h3><div class="docstring">
|
417
|
-
<div class="discussion">
|
418
|
-
<p class="note private">
|
419
|
-
<strong>This method is part of a private API.</strong>
|
420
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
421
|
-
</p>
|
422
|
-
|
423
|
-
<p>Returns True if a first match decision table.</p>
|
426
|
+
</td>
|
427
|
+
</tr>
|
428
|
+
</table>
|
429
|
+
</div>
|
430
|
+
|
431
|
+
</div>
|
432
|
+
|
433
|
+
<div id="instance_attr_details" class="attr_details">
|
434
|
+
<h2>Instance Attribute Details</h2>
|
435
|
+
|
436
|
+
|
437
|
+
<span id=""></span>
|
438
|
+
<div class="method_details first">
|
439
|
+
<h3 class="signature first" id="first_match-instance_method">
|
440
|
+
|
441
|
+
#<strong>first_match</strong> ⇒ <tt>Boolean</tt> <span class="extras">(readonly)</span>
|
424
442
|
|
425
443
|
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
<
|
431
|
-
<
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
<
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
</h3>
|
448
|
+
<div class="docstring">
|
449
|
+
<div class="discussion">
|
450
|
+
<p class="note private">
|
451
|
+
<strong>This method is part of a private API.</strong>
|
452
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
453
|
+
</p>
|
454
|
+
|
455
|
+
<p>Returns True if a first match decision table.</p>
|
456
|
+
|
457
|
+
|
458
|
+
</div>
|
459
|
+
</div>
|
460
|
+
<div class="tags">
|
461
|
+
|
462
|
+
<p class="tag_title">Returns:</p>
|
463
|
+
<ul class="return">
|
464
|
+
|
465
|
+
<li>
|
466
|
+
|
467
|
+
|
468
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
—
|
473
|
+
<div class='inline'>
|
474
|
+
<p>True if a first match decision table.</p>
|
475
|
+
</div>
|
476
|
+
|
477
|
+
</li>
|
478
|
+
|
479
|
+
</ul>
|
480
|
+
|
481
|
+
</div>
|
482
|
+
<table class="source_code">
|
483
|
+
<tr>
|
484
|
+
<td>
|
485
|
+
<pre class="lines">
|
453
486
|
|
454
487
|
|
455
488
|
28
|
456
489
|
29
|
457
490
|
30</pre>
|
458
|
-
|
459
|
-
|
460
|
-
|
491
|
+
</td>
|
492
|
+
<td>
|
493
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/decision.rb', line 28</span>
|
461
494
|
|
462
495
|
<span class='kw'>def</span> <span class='id identifier rubyid_first_match'>first_match</span>
|
463
496
|
<span class='ivar'>@first_match</span>
|
464
497
|
<span class='kw'>end</span></pre>
|
465
|
-
|
466
|
-
|
467
|
-
</table>
|
468
|
-
</div>
|
469
|
-
|
470
|
-
</div>
|
498
|
+
</td>
|
499
|
+
</tr>
|
500
|
+
</table>
|
501
|
+
</div>
|
471
502
|
|
503
|
+
</div>
|
472
504
|
|
473
|
-
<div id="class_method_details" class="method_details_list">
|
474
|
-
<h2>Class Method Details</h2>
|
475
505
|
|
476
|
-
|
477
|
-
|
478
|
-
<h3 class="signature first" id="make-class_method">
|
479
|
-
|
480
|
-
.<strong>make</strong>(table:, input:, symbolize_keys:) ⇒ <tt>Hash{Symbol=>Object}</tt>
|
481
|
-
|
506
|
+
<div id="class_method_details" class="method_details_list">
|
507
|
+
<h2>Class Method Details</h2>
|
482
508
|
|
483
|
-
|
484
509
|
|
485
|
-
|
486
|
-
|
487
|
-
<div class="discussion">
|
488
|
-
<p class="note private">
|
489
|
-
<strong>This method is part of a private API.</strong>
|
490
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
491
|
-
</p>
|
510
|
+
<div class="method_details first">
|
511
|
+
<h3 class="signature first" id="make-class_method">
|
492
512
|
|
493
|
-
|
513
|
+
.<strong>make</strong>(table:, input:, symbolize_keys:) ⇒ <tt>Hash{Symbol=>Object}</tt>
|
494
514
|
|
495
515
|
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
<
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
<p>
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
</
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
</
|
552
|
-
|
553
|
-
|
554
|
-
<
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
</
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
</h3>
|
520
|
+
<div class="docstring">
|
521
|
+
<div class="discussion">
|
522
|
+
<p class="note private">
|
523
|
+
<strong>This method is part of a private API.</strong>
|
524
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
525
|
+
</p>
|
526
|
+
|
527
|
+
<p>Main method for making decisions without a path.</p>
|
528
|
+
|
529
|
+
|
530
|
+
</div>
|
531
|
+
</div>
|
532
|
+
<div class="tags">
|
533
|
+
<p class="tag_title">Parameters:</p>
|
534
|
+
<ul class="param">
|
535
|
+
|
536
|
+
<li>
|
537
|
+
|
538
|
+
<span class='name'>table</span>
|
539
|
+
|
540
|
+
|
541
|
+
<span class='type'>(<tt><span class='object_link'><a href="Table.html"
|
542
|
+
title="CSVDecision2::Table (class)">CSVDecision2::Table</a></span></tt>)</span>
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
—
|
547
|
+
<div class='inline'>
|
548
|
+
<p>Decision table.</p>
|
549
|
+
</div>
|
550
|
+
|
551
|
+
</li>
|
552
|
+
|
553
|
+
<li>
|
554
|
+
|
555
|
+
<span class='name'>input</span>
|
556
|
+
|
557
|
+
|
558
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
—
|
563
|
+
<div class='inline'>
|
564
|
+
<p>Input hash (keys may or may not be symbolized)</p>
|
565
|
+
</div>
|
566
|
+
|
567
|
+
</li>
|
568
|
+
|
569
|
+
<li>
|
570
|
+
|
571
|
+
<span class='name'>symbolize_keys</span>
|
572
|
+
|
573
|
+
|
574
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
—
|
579
|
+
<div class='inline'>
|
580
|
+
<p>Set to false if keys are symbolized and it's OK to mutate the input
|
581
|
+
hash. Otherwise a copy of the input hash is symbolized.</p>
|
582
|
+
</div>
|
583
|
+
|
584
|
+
</li>
|
585
|
+
|
586
|
+
</ul>
|
587
|
+
|
588
|
+
<p class="tag_title">Returns:</p>
|
589
|
+
<ul class="return">
|
590
|
+
|
591
|
+
<li>
|
592
|
+
|
593
|
+
|
594
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
—
|
599
|
+
<div class='inline'>
|
600
|
+
<p>Decision result.</p>
|
601
|
+
</div>
|
602
|
+
|
603
|
+
</li>
|
604
|
+
|
605
|
+
</ul>
|
606
|
+
|
607
|
+
</div>
|
608
|
+
<table class="source_code">
|
609
|
+
<tr>
|
610
|
+
<td>
|
611
|
+
<pre class="lines">
|
576
612
|
|
577
613
|
|
578
614
|
18
|
@@ -583,107 +619,110 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
583
619
|
23
|
584
620
|
24
|
585
621
|
25</pre>
|
586
|
-
|
587
|
-
|
588
|
-
|
622
|
+
</td>
|
623
|
+
<td>
|
624
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/decision.rb', line 18</span>
|
589
625
|
|
590
626
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_make'>make</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>
|
591
627
|
<span class='comment'># Parse and transform the hash supplied as input
|
592
|
-
</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Input.html" title="
|
628
|
+
</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Input.html" title="CSVDecision2::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="CSVDecision2::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>
|
593
629
|
|
594
630
|
<span class='comment'># The decision object collects the results of the search and
|
595
631
|
</span> <span class='comment'># calculates the final result.
|
596
|
-
</span> <span class='const'><span class='object_link'><a href="" title="
|
632
|
+
</span> <span class='const'><span class='object_link'><a href="" title="CSVDecision2::Decision (class)">Decision</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="CSVDecision2::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='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_scan'><span class='object_link'><a href="#scan-instance_method" title="CSVDecision2::Decision#scan (method)">scan</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
597
633
|
<span class='kw'>end</span></pre>
|
598
|
-
|
599
|
-
|
600
|
-
</table>
|
601
|
-
</div>
|
602
|
-
|
603
|
-
</div>
|
634
|
+
</td>
|
635
|
+
</tr>
|
636
|
+
</table>
|
637
|
+
</div>
|
604
638
|
|
605
|
-
|
606
|
-
<h2>Instance Method Details</h2>
|
639
|
+
</div>
|
607
640
|
|
608
|
-
|
609
|
-
|
610
|
-
<h3 class="signature first" id="index_scan_accumulate-instance_method">
|
611
|
-
|
612
|
-
#<strong>index_scan_accumulate</strong>(scan_cols:, hash:, index_rows:) ⇒ <tt>Hash{Symbol=>Object}</tt>
|
613
|
-
|
641
|
+
<div id="instance_method_details" class="method_details_list">
|
642
|
+
<h2>Instance Method Details</h2>
|
614
643
|
|
615
|
-
|
616
644
|
|
617
|
-
|
618
|
-
|
619
|
-
<div class="discussion">
|
620
|
-
<p class="note private">
|
621
|
-
<strong>This method is part of a private API.</strong>
|
622
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
623
|
-
</p>
|
645
|
+
<div class="method_details first">
|
646
|
+
<h3 class="signature first" id="index_scan_accumulate-instance_method">
|
624
647
|
|
625
|
-
|
648
|
+
#<strong>index_scan_accumulate</strong>(scan_cols:, hash:, index_rows:) ⇒
|
649
|
+
<tt>Hash{Symbol=>Object}</tt>
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
|
654
|
+
|
655
|
+
</h3>
|
656
|
+
<div class="docstring">
|
657
|
+
<div class="discussion">
|
658
|
+
<p class="note private">
|
659
|
+
<strong>This method is part of a private API.</strong>
|
660
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
661
|
+
</p>
|
662
|
+
|
663
|
+
<p>Scan the index for an accumulated result.</p>
|
664
|
+
|
665
|
+
|
666
|
+
</div>
|
667
|
+
</div>
|
668
|
+
<div class="tags">
|
669
|
+
<p class="tag_title">Parameters:</p>
|
670
|
+
<ul class="param">
|
671
|
+
|
672
|
+
<li>
|
673
|
+
|
674
|
+
<span class='name'>scan_cols</span>
|
675
|
+
|
676
|
+
|
677
|
+
<span class='type'>(<tt>Hash{Integer=>Object}</tt>)</span>
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
</li>
|
682
|
+
|
683
|
+
<li>
|
684
|
+
|
685
|
+
<span class='name'>hash</span>
|
686
|
+
|
687
|
+
|
688
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
689
|
+
|
690
|
+
|
691
|
+
|
692
|
+
</li>
|
693
|
+
|
694
|
+
<li>
|
695
|
+
|
696
|
+
<span class='name'>index_rows</span>
|
697
|
+
|
698
|
+
|
699
|
+
<span class='type'>(<tt>Array<Integer></tt>)</span>
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
</li>
|
704
|
+
|
705
|
+
</ul>
|
706
|
+
|
707
|
+
<p class="tag_title">Returns:</p>
|
708
|
+
<ul class="return">
|
709
|
+
|
710
|
+
<li>
|
711
|
+
|
712
|
+
|
713
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
626
714
|
|
627
715
|
|
628
|
-
|
629
|
-
</
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
<span class='type'>(<tt>Hash{Integer=>Object}</tt>)</span>
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
</li>
|
644
|
-
|
645
|
-
<li>
|
646
|
-
|
647
|
-
<span class='name'>hash</span>
|
648
|
-
|
649
|
-
|
650
|
-
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
</li>
|
655
|
-
|
656
|
-
<li>
|
657
|
-
|
658
|
-
<span class='name'>index_rows</span>
|
659
|
-
|
660
|
-
|
661
|
-
<span class='type'>(<tt>Array<Integer></tt>)</span>
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
</li>
|
666
|
-
|
667
|
-
</ul>
|
668
|
-
|
669
|
-
<p class="tag_title">Returns:</p>
|
670
|
-
<ul class="return">
|
671
|
-
|
672
|
-
<li>
|
673
|
-
|
674
|
-
|
675
|
-
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
</li>
|
680
|
-
|
681
|
-
</ul>
|
682
|
-
|
683
|
-
</div><table class="source_code">
|
684
|
-
<tr>
|
685
|
-
<td>
|
686
|
-
<pre class="lines">
|
716
|
+
|
717
|
+
</li>
|
718
|
+
|
719
|
+
</ul>
|
720
|
+
|
721
|
+
</div>
|
722
|
+
<table class="source_code">
|
723
|
+
<tr>
|
724
|
+
<td>
|
725
|
+
<pre class="lines">
|
687
726
|
|
688
727
|
|
689
728
|
87
|
@@ -699,9 +738,9 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
699
738
|
97
|
700
739
|
98
|
701
740
|
99</pre>
|
702
|
-
|
703
|
-
|
704
|
-
|
741
|
+
</td>
|
742
|
+
<td>
|
743
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/decision.rb', line 87</span>
|
705
744
|
|
706
745
|
<span class='kw'>def</span> <span class='id identifier rubyid_index_scan_accumulate'>index_scan_accumulate</span><span class='lparen'>(</span><span class='label'>scan_cols:</span><span class='comma'>,</span> <span class='label'>hash:</span><span class='comma'>,</span> <span class='label'>index_rows:</span><span class='rparen'>)</span>
|
707
746
|
<span class='id identifier rubyid_index_rows'>index_rows</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_start_row'>start_row</span><span class='comma'>,</span> <span class='id identifier rubyid_end_row'>end_row</span><span class='op'>|</span>
|
@@ -716,89 +755,92 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
716
755
|
|
717
756
|
<span class='ivar'>@rows_picked</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='op'>:</span> <span class='id identifier rubyid_accumulated_result'>accumulated_result</span>
|
718
757
|
<span class='kw'>end</span></pre>
|
719
|
-
|
720
|
-
|
721
|
-
</table>
|
722
|
-
</div>
|
723
|
-
|
724
|
-
<div class="method_details ">
|
725
|
-
<h3 class="signature " id="index_scan_first_match-instance_method">
|
726
|
-
|
727
|
-
#<strong>index_scan_first_match</strong>(scan_cols:, hash:, index_rows:) ⇒ <tt>Hash{Symbol=>Object}</tt>
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
</h3><div class="docstring">
|
734
|
-
<div class="discussion">
|
735
|
-
<p class="note private">
|
736
|
-
<strong>This method is part of a private API.</strong>
|
737
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
738
|
-
</p>
|
739
|
-
|
740
|
-
<p>Scan the index for a first match result.</p>
|
758
|
+
</td>
|
759
|
+
</tr>
|
760
|
+
</table>
|
761
|
+
</div>
|
741
762
|
|
763
|
+
<div class="method_details ">
|
764
|
+
<h3 class="signature " id="index_scan_first_match-instance_method">
|
765
|
+
|
766
|
+
#<strong>index_scan_first_match</strong>(scan_cols:, hash:, index_rows:) ⇒
|
767
|
+
<tt>Hash{Symbol=>Object}</tt>
|
768
|
+
|
769
|
+
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
</h3>
|
774
|
+
<div class="docstring">
|
775
|
+
<div class="discussion">
|
776
|
+
<p class="note private">
|
777
|
+
<strong>This method is part of a private API.</strong>
|
778
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
779
|
+
</p>
|
780
|
+
|
781
|
+
<p>Scan the index for a first match result.</p>
|
782
|
+
|
783
|
+
|
784
|
+
</div>
|
785
|
+
</div>
|
786
|
+
<div class="tags">
|
787
|
+
<p class="tag_title">Parameters:</p>
|
788
|
+
<ul class="param">
|
789
|
+
|
790
|
+
<li>
|
791
|
+
|
792
|
+
<span class='name'>scan_cols</span>
|
793
|
+
|
794
|
+
|
795
|
+
<span class='type'>(<tt>Hash{Integer=>Object}</tt>)</span>
|
796
|
+
|
797
|
+
|
798
|
+
|
799
|
+
</li>
|
800
|
+
|
801
|
+
<li>
|
802
|
+
|
803
|
+
<span class='name'>hash</span>
|
804
|
+
|
805
|
+
|
806
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
742
807
|
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
<
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
</li>
|
781
|
-
|
782
|
-
</ul>
|
783
|
-
|
784
|
-
<p class="tag_title">Returns:</p>
|
785
|
-
<ul class="return">
|
786
|
-
|
787
|
-
<li>
|
788
|
-
|
789
|
-
|
790
|
-
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
</li>
|
795
|
-
|
796
|
-
</ul>
|
797
|
-
|
798
|
-
</div><table class="source_code">
|
799
|
-
<tr>
|
800
|
-
<td>
|
801
|
-
<pre class="lines">
|
808
|
+
|
809
|
+
|
810
|
+
</li>
|
811
|
+
|
812
|
+
<li>
|
813
|
+
|
814
|
+
<span class='name'>index_rows</span>
|
815
|
+
|
816
|
+
|
817
|
+
<span class='type'>(<tt>Array<Integer></tt>)</span>
|
818
|
+
|
819
|
+
|
820
|
+
|
821
|
+
</li>
|
822
|
+
|
823
|
+
</ul>
|
824
|
+
|
825
|
+
<p class="tag_title">Returns:</p>
|
826
|
+
<ul class="return">
|
827
|
+
|
828
|
+
<li>
|
829
|
+
|
830
|
+
|
831
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
832
|
+
|
833
|
+
|
834
|
+
|
835
|
+
</li>
|
836
|
+
|
837
|
+
</ul>
|
838
|
+
|
839
|
+
</div>
|
840
|
+
<table class="source_code">
|
841
|
+
<tr>
|
842
|
+
<td>
|
843
|
+
<pre class="lines">
|
802
844
|
|
803
845
|
|
804
846
|
69
|
@@ -812,9 +854,9 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
812
854
|
77
|
813
855
|
78
|
814
856
|
79</pre>
|
815
|
-
|
816
|
-
|
817
|
-
|
857
|
+
</td>
|
858
|
+
<td>
|
859
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/decision.rb', line 69</span>
|
818
860
|
|
819
861
|
<span class='kw'>def</span> <span class='id identifier rubyid_index_scan_first_match'>index_scan_first_match</span><span class='lparen'>(</span><span class='label'>scan_cols:</span><span class='comma'>,</span> <span class='label'>hash:</span><span class='comma'>,</span> <span class='label'>index_rows:</span><span class='rparen'>)</span>
|
820
862
|
<span class='id identifier rubyid_index_rows'>index_rows</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_start_row'>start_row</span><span class='comma'>,</span> <span class='id identifier rubyid_end_row'>end_row</span><span class='op'>|</span>
|
@@ -827,59 +869,61 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
827
869
|
|
828
870
|
<span class='lbrace'>{</span><span class='rbrace'>}</span>
|
829
871
|
<span class='kw'>end</span></pre>
|
830
|
-
|
831
|
-
|
832
|
-
</table>
|
833
|
-
</div>
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
</h3><div class="docstring">
|
845
|
-
<div class="discussion">
|
846
|
-
<p class="note private">
|
847
|
-
<strong>This method is part of a private API.</strong>
|
848
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
849
|
-
</p>
|
850
|
-
<p class="note returns_void">This method returns an undefined value.</p>
|
851
|
-
<p>Initialize the input data used to make the decision.</p>
|
872
|
+
</td>
|
873
|
+
</tr>
|
874
|
+
</table>
|
875
|
+
</div>
|
876
|
+
|
877
|
+
<div class="method_details ">
|
878
|
+
<h3 class="signature " id="input-instance_method">
|
879
|
+
|
880
|
+
#<strong>input</strong>(data) ⇒ <tt>void</tt>
|
881
|
+
|
882
|
+
|
852
883
|
|
853
884
|
|
854
|
-
|
855
|
-
</
|
856
|
-
<div class="
|
857
|
-
|
858
|
-
<
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
885
|
+
|
886
|
+
</h3>
|
887
|
+
<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
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
894
|
+
<p>Initialize the input data used to make the decision.</p>
|
895
|
+
|
896
|
+
|
897
|
+
</div>
|
898
|
+
</div>
|
899
|
+
<div class="tags">
|
900
|
+
<p class="tag_title">Parameters:</p>
|
901
|
+
<ul class="param">
|
902
|
+
|
903
|
+
<li>
|
904
|
+
|
905
|
+
<span class='name'>data</span>
|
906
|
+
|
907
|
+
|
908
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
909
|
+
|
910
|
+
|
911
|
+
|
912
|
+
—
|
913
|
+
<div class='inline'>
|
914
|
+
<p>Input hash data structure.</p>
|
915
|
+
</div>
|
916
|
+
|
917
|
+
</li>
|
918
|
+
|
919
|
+
</ul>
|
920
|
+
|
921
|
+
|
922
|
+
</div>
|
923
|
+
<table class="source_code">
|
924
|
+
<tr>
|
925
|
+
<td>
|
926
|
+
<pre class="lines">
|
883
927
|
|
884
928
|
|
885
929
|
43
|
@@ -891,9 +935,9 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
891
935
|
49
|
892
936
|
50
|
893
937
|
51</pre>
|
894
|
-
|
895
|
-
|
896
|
-
|
938
|
+
</td>
|
939
|
+
<td>
|
940
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/decision.rb', line 43</span>
|
897
941
|
|
898
942
|
<span class='kw'>def</span> <span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
899
943
|
<span class='ivar'>@result</span><span class='period'>.</span><span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:hash</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
@@ -904,77 +948,79 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
904
948
|
|
905
949
|
<span class='ivar'>@input</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span>
|
906
950
|
<span class='kw'>end</span></pre>
|
907
|
-
|
908
|
-
|
909
|
-
</table>
|
910
|
-
</div>
|
911
|
-
|
912
|
-
<div class="method_details ">
|
913
|
-
<h3 class="signature " id="scan-instance_method">
|
914
|
-
|
915
|
-
#<strong>scan</strong>(data) ⇒ <tt>Hash{Symbol=>Object}</tt>
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
</h3><div class="docstring">
|
922
|
-
<div class="discussion">
|
923
|
-
<p class="note private">
|
924
|
-
<strong>This method is part of a private API.</strong>
|
925
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
926
|
-
</p>
|
927
|
-
|
928
|
-
<p>Scan the decision table and produce an output decision.</p>
|
951
|
+
</td>
|
952
|
+
</tr>
|
953
|
+
</table>
|
954
|
+
</div>
|
929
955
|
|
956
|
+
<div class="method_details ">
|
957
|
+
<h3 class="signature " id="scan-instance_method">
|
930
958
|
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
</div>
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
<
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
</
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
959
|
+
#<strong>scan</strong>(data) ⇒ <tt>Hash{Symbol=>Object}</tt>
|
960
|
+
|
961
|
+
|
962
|
+
|
963
|
+
|
964
|
+
|
965
|
+
</h3>
|
966
|
+
<div class="docstring">
|
967
|
+
<div class="discussion">
|
968
|
+
<p class="note private">
|
969
|
+
<strong>This method is part of a private API.</strong>
|
970
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
971
|
+
</p>
|
972
|
+
|
973
|
+
<p>Scan the decision table and produce an output decision.</p>
|
974
|
+
|
975
|
+
|
976
|
+
</div>
|
977
|
+
</div>
|
978
|
+
<div class="tags">
|
979
|
+
<p class="tag_title">Parameters:</p>
|
980
|
+
<ul class="param">
|
981
|
+
|
982
|
+
<li>
|
983
|
+
|
984
|
+
<span class='name'>data</span>
|
985
|
+
|
986
|
+
|
987
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
988
|
+
|
989
|
+
|
990
|
+
|
991
|
+
—
|
992
|
+
<div class='inline'>
|
993
|
+
<p>Input hash data structure.</p>
|
994
|
+
</div>
|
995
|
+
|
996
|
+
</li>
|
997
|
+
|
998
|
+
</ul>
|
999
|
+
|
1000
|
+
<p class="tag_title">Returns:</p>
|
1001
|
+
<ul class="return">
|
1002
|
+
|
1003
|
+
<li>
|
1004
|
+
|
1005
|
+
|
1006
|
+
<span class='type'>(<tt>Hash{Symbol=>Object}</tt>)</span>
|
1007
|
+
|
1008
|
+
|
1009
|
+
|
1010
|
+
—
|
1011
|
+
<div class='inline'>
|
1012
|
+
<p>Decision result.</p>
|
1013
|
+
</div>
|
1014
|
+
|
1015
|
+
</li>
|
1016
|
+
|
1017
|
+
</ul>
|
1018
|
+
|
1019
|
+
</div>
|
1020
|
+
<table class="source_code">
|
1021
|
+
<tr>
|
1022
|
+
<td>
|
1023
|
+
<pre class="lines">
|
978
1024
|
|
979
1025
|
|
980
1026
|
57
|
@@ -982,30 +1028,31 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
982
1028
|
59
|
983
1029
|
60
|
984
1030
|
61</pre>
|
985
|
-
|
986
|
-
|
987
|
-
|
1031
|
+
</td>
|
1032
|
+
<td>
|
1033
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/decision.rb', line 57</span>
|
988
1034
|
|
989
1035
|
<span class='kw'>def</span> <span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
990
1036
|
<span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
991
1037
|
<span class='comment'># Use the table's index if present
|
992
1038
|
</span> <span class='ivar'>@table</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='op'>?</span> <span class='id identifier rubyid_index_scan'>index_scan</span> <span class='op'>:</span> <span class='id identifier rubyid_table_scan'>table_scan</span>
|
993
1039
|
<span class='kw'>end</span></pre>
|
994
|
-
|
995
|
-
|
996
|
-
</table>
|
997
|
-
</div>
|
998
|
-
|
999
|
-
</div>
|
1040
|
+
</td>
|
1041
|
+
</tr>
|
1042
|
+
</table>
|
1043
|
+
</div>
|
1000
1044
|
|
1001
|
-
</div>
|
1045
|
+
</div>
|
1002
1046
|
|
1003
|
-
|
1004
|
-
Generated on Sun Feb 11 10:26:08 2018 by
|
1005
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1006
|
-
0.9.12 (ruby-2.4.0).
|
1007
|
-
</div>
|
1047
|
+
</div>
|
1008
1048
|
|
1049
|
+
<div id="footer">
|
1050
|
+
Generated on Sun Feb 11 10:26:08 2018 by
|
1051
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1052
|
+
0.9.12 (ruby-2.4.0).
|
1009
1053
|
</div>
|
1010
|
-
|
1011
|
-
</
|
1054
|
+
|
1055
|
+
</div>
|
1056
|
+
</body>
|
1057
|
+
|
1058
|
+
</html>
|