csv_decision2 0.5.1 → 0.5.2
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/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::Matchers
|
|
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::Matchers";
|
|
20
|
+
relpath = '../';
|
|
21
|
+
</script>
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
@@ -25,1013 +26,1109 @@
|
|
|
25
26
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
26
27
|
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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 (M)</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">Matchers</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>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div id="content">
|
|
65
|
+
<h1>Class: CSVDecision2::Matchers
|
|
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::Matchers</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.rb<span class="defines">,<br />
|
|
101
|
+
lib/csv_decision2/matchers.rb,<br /> lib/csv_decision2/matchers/guard.rb,<br />
|
|
102
|
+
lib/csv_decision2/matchers/range.rb,<br /> lib/csv_decision2/matchers/symbol.rb,<br />
|
|
103
|
+
lib/csv_decision2/matchers/numeric.rb,<br /> lib/csv_decision2/matchers/pattern.rb,<br />
|
|
104
|
+
lib/csv_decision2/matchers/constant.rb,<br /> lib/csv_decision2/matchers/function.rb</span>
|
|
105
|
+
</dd>
|
|
106
|
+
</dl>
|
|
107
|
+
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<h2>Overview</h2>
|
|
111
|
+
<div class="docstring">
|
|
112
|
+
<div class="discussion">
|
|
113
|
+
<p class="note private">
|
|
114
|
+
<strong>This class is part of a private API.</strong>
|
|
115
|
+
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
|
116
|
+
</p>
|
|
117
|
+
|
|
118
|
+
<p>Methods to assign a matcher to data cells</p>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="tags">
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
</div>
|
|
127
|
+
<h2>Defined Under Namespace</h2>
|
|
128
|
+
<p class="children">
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Matchers/Constant.html"
|
|
134
|
+
title="CSVDecision2::Matchers::Constant (class)">Constant</a></span>, <span class='object_link'><a
|
|
135
|
+
href="Matchers/Function.html" title="CSVDecision2::Matchers::Function (class)">Function</a></span>, <span
|
|
136
|
+
class='object_link'><a href="Matchers/Guard.html"
|
|
137
|
+
title="CSVDecision2::Matchers::Guard (class)">Guard</a></span>, <span class='object_link'><a
|
|
138
|
+
href="Matchers/Matcher.html" title="CSVDecision2::Matchers::Matcher (class)">Matcher</a></span>, <span
|
|
139
|
+
class='object_link'><a href="Matchers/Numeric.html"
|
|
140
|
+
title="CSVDecision2::Matchers::Numeric (class)">Numeric</a></span>, <span class='object_link'><a
|
|
141
|
+
href="Matchers/Pattern.html" title="CSVDecision2::Matchers::Pattern (class)">Pattern</a></span>, <span
|
|
142
|
+
class='object_link'><a href="Matchers/Proc.html" title="CSVDecision2::Matchers::Proc (class)">Proc</a></span>,
|
|
143
|
+
<span class='object_link'><a href="Matchers/Range.html"
|
|
144
|
+
title="CSVDecision2::Matchers::Range (class)">Range</a></span>, <span class='object_link'><a
|
|
145
|
+
href="Matchers/Symbol.html" title="CSVDecision2::Matchers::Symbol (class)">Symbol</a></span>
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
</p>
|
|
149
|
+
|
|
150
|
+
<h2>Constant Summary</h2>
|
|
151
|
+
<dl class="constants">
|
|
152
|
+
|
|
153
|
+
<dt id="NEGATE-constant" class="">NEGATE =
|
|
154
|
+
<div class="docstring">
|
|
155
|
+
<div class="discussion">
|
|
156
|
+
<p class="note private">
|
|
157
|
+
<strong>This constant is part of a private API.</strong>
|
|
158
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
159
|
+
</p>
|
|
160
|
+
|
|
161
|
+
<p>Negation sign prefixed to ranges and functions.</p>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="tags">
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
</div>
|
|
170
|
+
</dt>
|
|
171
|
+
<dd>
|
|
172
|
+
<pre
|
|
173
|
+
class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>!</span><span class='tstring_end'>'</span></span></pre>
|
|
174
|
+
</dd>
|
|
175
|
+
|
|
176
|
+
<dt id="INEQUALITY-constant" class="">INEQUALITY =
|
|
177
|
+
<div class="docstring">
|
|
178
|
+
<div class="discussion">
|
|
179
|
+
<p class="note private">
|
|
180
|
+
<strong>This constant is part of a private API.</strong>
|
|
181
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
182
|
+
</p>
|
|
183
|
+
|
|
184
|
+
<p>Symbols used for inequality</p>
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
<div class="tags">
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
</div>
|
|
193
|
+
</dt>
|
|
194
|
+
<dd>
|
|
195
|
+
<pre
|
|
196
|
+
class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>!=|!</span><span class='tstring_end'>'</span></span></pre>
|
|
197
|
+
</dd>
|
|
198
|
+
|
|
199
|
+
<dt id="INEQUALITY_RE-constant" class="">INEQUALITY_RE =
|
|
200
|
+
<div class="docstring">
|
|
201
|
+
<div class="discussion">
|
|
202
|
+
<p class="note private">
|
|
203
|
+
<strong>This constant is part of a private API.</strong>
|
|
204
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
205
|
+
</p>
|
|
206
|
+
|
|
207
|
+
<p>Match Regexp for inequality</p>
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
<div class="tags">
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
</div>
|
|
216
|
+
</dt>
|
|
217
|
+
<dd>
|
|
218
|
+
<pre
|
|
219
|
+
class="code"><span class='id identifier rubyid_regexp'>regexp</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#INEQUALITY-constant" title="CSVDecision2::Matchers::INEQUALITY (constant)">INEQUALITY</a></span></span><span class='rparen'>)</span></pre>
|
|
220
|
+
</dd>
|
|
221
|
+
|
|
222
|
+
<dt id="EQUALS-constant" class="">EQUALS =
|
|
223
|
+
<div class="docstring">
|
|
224
|
+
<div class="discussion">
|
|
225
|
+
<p class="note private">
|
|
226
|
+
<strong>This constant is part of a private API.</strong>
|
|
227
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
228
|
+
</p>
|
|
229
|
+
|
|
230
|
+
<p>Equality, cell constants and functions specified by prefixing the value
|
|
231
|
+
with one of these 3 symbols.</p>
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
<div class="tags">
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
</div>
|
|
240
|
+
</dt>
|
|
241
|
+
<dd>
|
|
242
|
+
<pre
|
|
243
|
+
class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>==|:=|=</span><span class='tstring_end'>'</span></span></pre>
|
|
244
|
+
</dd>
|
|
245
|
+
|
|
246
|
+
<dt id="EQUALS_RE-constant" class="">EQUALS_RE =
|
|
247
|
+
<div class="docstring">
|
|
248
|
+
<div class="discussion">
|
|
249
|
+
<p class="note private">
|
|
250
|
+
<strong>This constant is part of a private API.</strong>
|
|
251
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
252
|
+
</p>
|
|
253
|
+
|
|
254
|
+
<p>Match Regexp for equality</p>
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
<div class="tags">
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
</div>
|
|
263
|
+
</dt>
|
|
264
|
+
<dd>
|
|
265
|
+
<pre
|
|
266
|
+
class="code"><span class='id identifier rubyid_regexp'>regexp</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#EQUALS-constant" title="CSVDecision2::Matchers::EQUALS (constant)">EQUALS</a></span></span><span class='rparen'>)</span></pre>
|
|
267
|
+
</dd>
|
|
268
|
+
|
|
269
|
+
<dt id="METHOD_NAME_RE-constant" class="">METHOD_NAME_RE =
|
|
270
|
+
<div class="docstring">
|
|
271
|
+
<div class="discussion">
|
|
272
|
+
<p class="note private">
|
|
273
|
+
<strong>This constant is part of a private API.</strong>
|
|
274
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
275
|
+
</p>
|
|
276
|
+
|
|
277
|
+
<p>Method names are stricter than CSV column names.</p>
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
<div class="tags">
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
</div>
|
|
286
|
+
</dt>
|
|
287
|
+
<dd>
|
|
288
|
+
<pre
|
|
289
|
+
class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A[_a-z][_a-z0-9]*[?!=]?\z</span><span class='regexp_end'>/</span></span></pre>
|
|
290
|
+
</dd>
|
|
291
|
+
|
|
292
|
+
<dt id="NUMERIC-constant" class="">NUMERIC =
|
|
293
|
+
<div class="docstring">
|
|
294
|
+
<div class="discussion">
|
|
295
|
+
<p class="note private">
|
|
296
|
+
<strong>This constant is part of a private API.</strong>
|
|
297
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
298
|
+
</p>
|
|
299
|
+
|
|
300
|
+
<p>Regular expression used to recognise a numeric string with or without a
|
|
301
|
+
decimal point.</p>
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
<div class="tags">
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
</div>
|
|
310
|
+
</dt>
|
|
311
|
+
<dd>
|
|
312
|
+
<pre
|
|
313
|
+
class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>[-+]?\d*(?<decimal>\.?)\d*</span><span class='tstring_end'>'</span></span></pre>
|
|
314
|
+
</dd>
|
|
315
|
+
|
|
316
|
+
</dl>
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
322
|
+
<ul class="summary">
|
|
323
|
+
|
|
324
|
+
<li class="public ">
|
|
325
|
+
<span class="summary_signature">
|
|
326
|
+
|
|
327
|
+
<a href="#ins-instance_method" title="#ins (instance method)">#<strong>ins</strong> ⇒
|
|
328
|
+
Array<Matchers::Matcher> </a>
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
</span>
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
<span class="note title readonly">readonly</span>
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
<span class="private note title">private</span>
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
<span class="summary_desc">
|
|
348
|
+
<div class='inline'>
|
|
349
|
+
<p>Matchers for the input columns.</p>
|
|
350
|
+
</div>
|
|
351
|
+
</span>
|
|
352
|
+
|
|
353
|
+
</li>
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
<li class="public ">
|
|
357
|
+
<span class="summary_signature">
|
|
358
|
+
|
|
359
|
+
<a href="#outs-instance_method" title="#outs (instance method)">#<strong>outs</strong> ⇒
|
|
360
|
+
Array<Matchers::Matcher> </a>
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
</span>
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
<span class="note title readonly">readonly</span>
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
<span class="private note title">private</span>
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
<span class="summary_desc">
|
|
380
|
+
<div class='inline'>
|
|
381
|
+
<p>Matchers for the output columns.</p>
|
|
382
|
+
</div>
|
|
383
|
+
</span>
|
|
384
|
+
|
|
385
|
+
</li>
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
</ul>
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
<h2>
|
|
395
|
+
Class Method Summary
|
|
396
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
397
|
+
</h2>
|
|
398
|
+
|
|
399
|
+
<ul class="summary">
|
|
400
|
+
|
|
401
|
+
<li class="public ">
|
|
402
|
+
<span class="summary_signature">
|
|
403
|
+
|
|
404
|
+
<a href="#compare%3F-class_method" title="compare? (class method)">.<strong>compare?</strong>(lhs:,
|
|
405
|
+
compare:, rhs:) ⇒ nil, Boolean </a>
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
</span>
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
<span class="private note title">private</span>
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
<span class="summary_desc">
|
|
420
|
+
<div class='inline'>
|
|
421
|
+
<p>Compare one object with another if they both respond to the compare method.</p>
|
|
422
|
+
</div>
|
|
423
|
+
</span>
|
|
424
|
+
|
|
425
|
+
</li>
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
<li class="public ">
|
|
429
|
+
<span class="summary_signature">
|
|
430
|
+
|
|
431
|
+
<a href="#normalize_operator-class_method"
|
|
432
|
+
title="normalize_operator (class method)">.<strong>normalize_operator</strong>(operator) ⇒ String
|
|
433
|
+
</a>
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
</span>
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
<span class="private note title">private</span>
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
<span class="summary_desc">
|
|
448
|
+
<div class='inline'>
|
|
449
|
+
<p>Normalize the operators which are a variation on equals/assignment.</p>
|
|
450
|
+
</div>
|
|
451
|
+
</span>
|
|
452
|
+
|
|
453
|
+
</li>
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
<li class="public ">
|
|
457
|
+
<span class="summary_signature">
|
|
458
|
+
|
|
459
|
+
<a href="#numeric-class_method" title="numeric (class method)">.<strong>numeric</strong>(value) ⇒
|
|
460
|
+
nil, ... </a>
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
</span>
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
<span class="private note title">private</span>
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
<span class="summary_desc">
|
|
475
|
+
<div class='inline'>
|
|
476
|
+
<p>Validate a numeric value and convert it to an Integer or BigDecimal if a
|
|
477
|
+
valid numeric string.</p>
|
|
478
|
+
</div>
|
|
479
|
+
</span>
|
|
480
|
+
|
|
481
|
+
</li>
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
<li class="public ">
|
|
485
|
+
<span class="summary_signature">
|
|
486
|
+
|
|
487
|
+
<a href="#parse-class_method" title="parse (class method)">.<strong>parse</strong>(columns:, matchers:,
|
|
488
|
+
row:) ⇒ Array<(Array, ScanRow)> </a>
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
</span>
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
<span class="private note title">private</span>
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
<span class="summary_desc">
|
|
503
|
+
<div class='inline'>
|
|
504
|
+
<p>Parse the supplied input columns for the row supplied using an array of
|
|
505
|
+
matchers.</p>
|
|
506
|
+
</div>
|
|
507
|
+
</span>
|
|
508
|
+
|
|
509
|
+
</li>
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
<li class="public ">
|
|
513
|
+
<span class="summary_signature">
|
|
514
|
+
|
|
515
|
+
<a href="#regexp-class_method" title="regexp (class method)">.<strong>regexp</strong>(value) ⇒ Regexp
|
|
516
|
+
</a>
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
</span>
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
<span class="private note title">private</span>
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
<span class="summary_desc">
|
|
531
|
+
<div class='inline'>
|
|
532
|
+
<p>All regular expressions used for matching are anchored inside their own
|
|
533
|
+
non-capturing group.</p>
|
|
534
|
+
</div>
|
|
535
|
+
</span>
|
|
536
|
+
|
|
537
|
+
</li>
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
<li class="public ">
|
|
541
|
+
<span class="summary_signature">
|
|
542
|
+
|
|
543
|
+
<a href="#to_numeric-class_method" title="to_numeric (class method)">.<strong>to_numeric</strong>(value)
|
|
544
|
+
⇒ nil, ... </a>
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
</span>
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
<span class="private note title">private</span>
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
<span class="summary_desc">
|
|
559
|
+
<div class='inline'>
|
|
560
|
+
<p>Convert a numeric string into an Integer or BigDecimal, otherwise return
|
|
561
|
+
nil.</p>
|
|
562
|
+
</div>
|
|
563
|
+
</span>
|
|
564
|
+
|
|
565
|
+
</li>
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
</ul>
|
|
569
|
+
|
|
570
|
+
<h2>
|
|
571
|
+
Instance Method Summary
|
|
572
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
573
|
+
</h2>
|
|
574
|
+
|
|
575
|
+
<ul class="summary">
|
|
576
|
+
|
|
577
|
+
<li class="public ">
|
|
578
|
+
<span class="summary_signature">
|
|
579
|
+
|
|
580
|
+
<a href="#initialize-instance_method"
|
|
581
|
+
title="#initialize (instance method)">#<strong>initialize</strong>(options) ⇒ Matchers </a>
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
</span>
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
<span class="note title constructor">constructor</span>
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
<span class="private note title">private</span>
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
<span class="summary_desc">
|
|
598
|
+
<div class='inline'>
|
|
599
|
+
<p>A new instance of Matchers.</p>
|
|
600
|
+
</div>
|
|
601
|
+
</span>
|
|
602
|
+
|
|
603
|
+
</li>
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
<li class="public ">
|
|
607
|
+
<span class="summary_signature">
|
|
608
|
+
|
|
609
|
+
<a href="#parse_ins-instance_method"
|
|
610
|
+
title="#parse_ins (instance method)">#<strong>parse_ins</strong>(columns:, row:) ⇒ Array<(Array,
|
|
611
|
+
ScanRow)> </a>
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
</span>
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
<span class="private note title">private</span>
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
<span class="summary_desc">
|
|
626
|
+
<div class='inline'>
|
|
627
|
+
<p>Parse the row's input columns using the input matchers.</p>
|
|
628
|
+
</div>
|
|
629
|
+
</span>
|
|
630
|
+
|
|
631
|
+
</li>
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
<li class="public ">
|
|
635
|
+
<span class="summary_signature">
|
|
636
|
+
|
|
637
|
+
<a href="#parse_outs-instance_method"
|
|
638
|
+
title="#parse_outs (instance method)">#<strong>parse_outs</strong>(columns:, row:) ⇒
|
|
639
|
+
Array<(Array, ScanRow)> </a>
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
</span>
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
<span class="private note title">private</span>
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
<span class="summary_desc">
|
|
654
|
+
<div class='inline'>
|
|
655
|
+
<p>Parse the row's output columns using the output matchers.</p>
|
|
656
|
+
</div>
|
|
657
|
+
</span>
|
|
658
|
+
|
|
659
|
+
</li>
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
</ul>
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
<div id="constructor_details" class="method_details_list">
|
|
666
|
+
<h2>Constructor Details</h2>
|
|
667
|
+
|
|
668
|
+
<div class="method_details first">
|
|
669
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
670
|
+
|
|
671
|
+
#<strong>initialize</strong>(options) ⇒ <tt><span class='object_link'><a href=""
|
|
672
|
+
title="CSVDecision2::Matchers (class)">Matchers</a></span></tt>
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
</h3>
|
|
679
|
+
<div class="docstring">
|
|
680
|
+
<div class="discussion">
|
|
681
|
+
<p class="note private">
|
|
682
|
+
<strong>This method is part of a private API.</strong>
|
|
683
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
684
|
+
</p>
|
|
685
|
+
|
|
686
|
+
<p>Returns a new instance of Matchers</p>
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
</div>
|
|
690
|
+
</div>
|
|
691
|
+
<div class="tags">
|
|
692
|
+
<p class="tag_title">Parameters:</p>
|
|
693
|
+
<ul class="param">
|
|
694
|
+
|
|
695
|
+
<li>
|
|
696
|
+
|
|
697
|
+
<span class='name'>options</span>
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
<span class='type'>(<tt>Hash{<span class='object_link'><a href="Matchers/Symbol.html"
|
|
701
|
+
title="CSVDecision2::Matchers::Symbol (class)">Symbol</a></span>=>Object}</tt>)</span>
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
—
|
|
706
|
+
<div class='inline'>
|
|
707
|
+
<p>Options hash controlling how the table is parsed and interpreted.</p>
|
|
708
|
+
</div>
|
|
709
|
+
|
|
710
|
+
</li>
|
|
711
|
+
|
|
712
|
+
</ul>
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
</div>
|
|
716
|
+
<table class="source_code">
|
|
717
|
+
<tr>
|
|
718
|
+
<td>
|
|
719
|
+
<pre class="lines">
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
167
|
|
723
|
+
168
|
|
724
|
+
169
|
|
725
|
+
170
|
|
726
|
+
171</pre>
|
|
727
|
+
</td>
|
|
728
|
+
<td>
|
|
729
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 167</span>
|
|
730
|
+
|
|
731
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
732
|
+
<span class='id identifier rubyid_matchers'>matchers</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:matchers</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_klass'>klass</span><span class='op'>|</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
733
|
+
<span class='ivar'>@ins</span> <span class='op'>=</span> <span class='id identifier rubyid_matchers'>matchers</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:ins?</span><span class='rparen'>)</span>
|
|
734
|
+
<span class='ivar'>@outs</span> <span class='op'>=</span> <span class='id identifier rubyid_matchers'>matchers</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:outs?</span><span class='rparen'>)</span>
|
|
735
|
+
<span class='kw'>end</span></pre>
|
|
736
|
+
</td>
|
|
737
|
+
</tr>
|
|
738
|
+
</table>
|
|
739
|
+
</div>
|
|
740
|
+
|
|
741
|
+
</div>
|
|
742
|
+
|
|
743
|
+
<div id="instance_attr_details" class="attr_details">
|
|
744
|
+
<h2>Instance Attribute Details</h2>
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
<span id=""></span>
|
|
748
|
+
<div class="method_details first">
|
|
749
|
+
<h3 class="signature first" id="ins-instance_method">
|
|
750
|
+
|
|
751
|
+
#<strong>ins</strong> ⇒ <tt>Array<<span class='object_link'><a href="Matchers/Matcher.html"
|
|
752
|
+
title="CSVDecision2::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt> <span
|
|
753
|
+
class="extras">(readonly)</span>
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
</h3>
|
|
760
|
+
<div class="docstring">
|
|
761
|
+
<div class="discussion">
|
|
762
|
+
<p class="note private">
|
|
763
|
+
<strong>This method is part of a private API.</strong>
|
|
764
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
765
|
+
</p>
|
|
766
|
+
|
|
767
|
+
<p>Returns Matchers for the input columns.</p>
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
</div>
|
|
771
|
+
</div>
|
|
772
|
+
<div class="tags">
|
|
773
|
+
|
|
774
|
+
<p class="tag_title">Returns:</p>
|
|
775
|
+
<ul class="return">
|
|
776
|
+
|
|
777
|
+
<li>
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
<span class='type'>(<tt>Array<<span class='object_link'><a href="Matchers/Matcher.html"
|
|
781
|
+
title="CSVDecision2::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt>)</span>
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
—
|
|
786
|
+
<div class='inline'>
|
|
787
|
+
<p>Matchers for the input columns.</p>
|
|
788
|
+
</div>
|
|
789
|
+
|
|
790
|
+
</li>
|
|
791
|
+
|
|
792
|
+
</ul>
|
|
793
|
+
|
|
794
|
+
</div>
|
|
795
|
+
<table class="source_code">
|
|
796
|
+
<tr>
|
|
797
|
+
<td>
|
|
798
|
+
<pre class="lines">
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
161
|
|
802
|
+
162
|
|
803
|
+
163</pre>
|
|
804
|
+
</td>
|
|
805
|
+
<td>
|
|
806
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 161</span>
|
|
807
|
+
|
|
808
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span>
|
|
809
|
+
<span class='ivar'>@ins</span>
|
|
810
|
+
<span class='kw'>end</span></pre>
|
|
811
|
+
</td>
|
|
812
|
+
</tr>
|
|
813
|
+
</table>
|
|
814
|
+
</div>
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
<span id=""></span>
|
|
818
|
+
<div class="method_details ">
|
|
819
|
+
<h3 class="signature " id="outs-instance_method">
|
|
820
|
+
|
|
821
|
+
#<strong>outs</strong> ⇒ <tt>Array<<span class='object_link'><a href="Matchers/Matcher.html"
|
|
822
|
+
title="CSVDecision2::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt> <span
|
|
823
|
+
class="extras">(readonly)</span>
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
</h3>
|
|
830
|
+
<div class="docstring">
|
|
831
|
+
<div class="discussion">
|
|
832
|
+
<p class="note private">
|
|
833
|
+
<strong>This method is part of a private API.</strong>
|
|
834
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
835
|
+
</p>
|
|
836
|
+
|
|
837
|
+
<p>Returns Matchers for the output columns.</p>
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
</div>
|
|
841
|
+
</div>
|
|
842
|
+
<div class="tags">
|
|
843
|
+
|
|
844
|
+
<p class="tag_title">Returns:</p>
|
|
845
|
+
<ul class="return">
|
|
846
|
+
|
|
847
|
+
<li>
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
<span class='type'>(<tt>Array<<span class='object_link'><a href="Matchers/Matcher.html"
|
|
851
|
+
title="CSVDecision2::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt>)</span>
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
—
|
|
856
|
+
<div class='inline'>
|
|
857
|
+
<p>Matchers for the output columns.</p>
|
|
858
|
+
</div>
|
|
859
|
+
|
|
860
|
+
</li>
|
|
861
|
+
|
|
862
|
+
</ul>
|
|
863
|
+
|
|
864
|
+
</div>
|
|
865
|
+
<table class="source_code">
|
|
866
|
+
<tr>
|
|
867
|
+
<td>
|
|
868
|
+
<pre class="lines">
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
164
|
|
872
|
+
165
|
|
873
|
+
166</pre>
|
|
874
|
+
</td>
|
|
875
|
+
<td>
|
|
876
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 164</span>
|
|
877
|
+
|
|
878
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_outs'>outs</span>
|
|
879
|
+
<span class='ivar'>@outs</span>
|
|
880
|
+
<span class='kw'>end</span></pre>
|
|
881
|
+
</td>
|
|
882
|
+
</tr>
|
|
883
|
+
</table>
|
|
884
|
+
</div>
|
|
885
|
+
|
|
886
|
+
</div>
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
<div id="class_method_details" class="method_details_list">
|
|
890
|
+
<h2>Class Method Details</h2>
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
<div class="method_details first">
|
|
894
|
+
<h3 class="signature first" id="compare?-class_method">
|
|
895
|
+
|
|
896
|
+
.<strong>compare?</strong>(lhs:, compare:, rhs:) ⇒ <tt>nil</tt>, <tt>Boolean</tt>
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
</h3>
|
|
903
|
+
<div class="docstring">
|
|
904
|
+
<div class="discussion">
|
|
905
|
+
<p class="note private">
|
|
906
|
+
<strong>This method is part of a private API.</strong>
|
|
907
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
908
|
+
</p>
|
|
909
|
+
|
|
910
|
+
<p>Compare one object with another if they both respond to the compare method.</p>
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
</div>
|
|
914
|
+
</div>
|
|
915
|
+
<div class="tags">
|
|
916
|
+
<p class="tag_title">Parameters:</p>
|
|
917
|
+
<ul class="param">
|
|
918
|
+
|
|
919
|
+
<li>
|
|
920
|
+
|
|
921
|
+
<span class='name'>lhs</span>
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
</li>
|
|
929
|
+
|
|
930
|
+
<li>
|
|
931
|
+
|
|
932
|
+
<span class='name'>compare</span>
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
</li>
|
|
940
|
+
|
|
941
|
+
<li>
|
|
942
|
+
|
|
943
|
+
<span class='name'>rhs</span>
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
</li>
|
|
951
|
+
|
|
952
|
+
</ul>
|
|
953
|
+
|
|
954
|
+
<p class="tag_title">Returns:</p>
|
|
955
|
+
<ul class="return">
|
|
956
|
+
|
|
957
|
+
<li>
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
<span class='type'>(<tt>nil</tt>, <tt>Boolean</tt>)</span>
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
</li>
|
|
965
|
+
|
|
966
|
+
</ul>
|
|
967
|
+
|
|
968
|
+
</div>
|
|
969
|
+
<table class="source_code">
|
|
970
|
+
<tr>
|
|
971
|
+
<td>
|
|
972
|
+
<pre class="lines">
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
133
|
|
976
|
+
134
|
|
977
|
+
135
|
|
978
|
+
136
|
|
979
|
+
137
|
|
980
|
+
138
|
|
981
|
+
139</pre>
|
|
982
|
+
</td>
|
|
983
|
+
<td>
|
|
984
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 133</span>
|
|
985
|
+
|
|
986
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_compare?'>compare?</span><span class='lparen'>(</span><span class='label'>lhs:</span><span class='comma'>,</span> <span class='label'>compare:</span><span class='comma'>,</span> <span class='label'>rhs:</span><span class='rparen'>)</span>
|
|
987
|
+
<span class='comment'># Is the rhs the same class or a superclass of lhs, and does rhs respond to the
|
|
988
|
+
</span> <span class='comment'># compare method?
|
|
989
|
+
</span> <span class='kw'>return</span> <span class='id identifier rubyid_lhs'>lhs</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_compare'>compare</span><span class='comma'>,</span> <span class='id identifier rubyid_rhs'>rhs</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_lhs'>lhs</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='id identifier rubyid_rhs'>rhs</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_rhs'>rhs</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_compare'>compare</span><span class='rparen'>)</span>
|
|
34
990
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
»
|
|
42
|
-
<span class="title">Matchers</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>
|
|
991
|
+
<span class='kw'>nil</span>
|
|
992
|
+
<span class='kw'>end</span></pre>
|
|
993
|
+
</td>
|
|
994
|
+
</tr>
|
|
995
|
+
</table>
|
|
996
|
+
</div>
|
|
61
997
|
|
|
62
|
-
|
|
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::Matchers</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.rb<span class="defines">,<br />
|
|
98
|
-
lib/csv_decision/matchers.rb,<br /> lib/csv_decision/matchers/guard.rb,<br /> lib/csv_decision/matchers/range.rb,<br /> lib/csv_decision/matchers/symbol.rb,<br /> lib/csv_decision/matchers/numeric.rb,<br /> lib/csv_decision/matchers/pattern.rb,<br /> lib/csv_decision/matchers/constant.rb,<br /> lib/csv_decision/matchers/function.rb</span>
|
|
99
|
-
</dd>
|
|
100
|
-
</dl>
|
|
101
|
-
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<h2>Overview</h2><div class="docstring">
|
|
105
|
-
<div class="discussion">
|
|
106
|
-
<p class="note private">
|
|
107
|
-
<strong>This class is part of a private API.</strong>
|
|
108
|
-
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
|
109
|
-
</p>
|
|
110
|
-
|
|
111
|
-
<p>Methods to assign a matcher to data cells</p>
|
|
998
|
+
<div class="method_details ">
|
|
999
|
+
<h3 class="signature " id="normalize_operator-class_method">
|
|
112
1000
|
|
|
1001
|
+
.<strong>normalize_operator</strong>(operator) ⇒ <tt>String</tt>
|
|
113
1002
|
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
<div class="tags">
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</div><h2>Defined Under Namespace</h2>
|
|
120
|
-
<p class="children">
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Matchers/Constant.html" title="CSVDecision::Matchers::Constant (class)">Constant</a></span>, <span class='object_link'><a href="Matchers/Function.html" title="CSVDecision::Matchers::Function (class)">Function</a></span>, <span class='object_link'><a href="Matchers/Guard.html" title="CSVDecision::Matchers::Guard (class)">Guard</a></span>, <span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matcher</a></span>, <span class='object_link'><a href="Matchers/Numeric.html" title="CSVDecision::Matchers::Numeric (class)">Numeric</a></span>, <span class='object_link'><a href="Matchers/Pattern.html" title="CSVDecision::Matchers::Pattern (class)">Pattern</a></span>, <span class='object_link'><a href="Matchers/Proc.html" title="CSVDecision::Matchers::Proc (class)">Proc</a></span>, <span class='object_link'><a href="Matchers/Range.html" title="CSVDecision::Matchers::Range (class)">Range</a></span>, <span class='object_link'><a href="Matchers/Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</p>
|
|
129
|
-
|
|
130
|
-
<h2>Constant Summary</h2>
|
|
131
|
-
<dl class="constants">
|
|
132
|
-
|
|
133
|
-
<dt id="NEGATE-constant" class="">NEGATE =
|
|
134
|
-
<div class="docstring">
|
|
135
|
-
<div class="discussion">
|
|
136
|
-
<p class="note private">
|
|
137
|
-
<strong>This constant is part of a private API.</strong>
|
|
138
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
139
|
-
</p>
|
|
140
|
-
|
|
141
|
-
<p>Negation sign prefixed to ranges and functions.</p>
|
|
142
1003
|
|
|
143
1004
|
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
<div class="tags">
|
|
147
|
-
|
|
148
1005
|
|
|
149
|
-
</div>
|
|
150
|
-
</dt>
|
|
151
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>!</span><span class='tstring_end'>'</span></span></pre></dd>
|
|
152
|
-
|
|
153
|
-
<dt id="INEQUALITY-constant" class="">INEQUALITY =
|
|
154
|
-
<div class="docstring">
|
|
155
|
-
<div class="discussion">
|
|
156
|
-
<p class="note private">
|
|
157
|
-
<strong>This constant is part of a private API.</strong>
|
|
158
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
159
|
-
</p>
|
|
160
1006
|
|
|
161
|
-
|
|
1007
|
+
</h3>
|
|
1008
|
+
<div class="docstring">
|
|
1009
|
+
<div class="discussion">
|
|
1010
|
+
<p class="note private">
|
|
1011
|
+
<strong>This method is part of a private API.</strong>
|
|
1012
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1013
|
+
</p>
|
|
162
1014
|
|
|
1015
|
+
<p>Normalize the operators which are a variation on equals/assignment.</p>
|
|
163
1016
|
|
|
164
|
-
</div>
|
|
165
|
-
</div>
|
|
166
|
-
<div class="tags">
|
|
167
|
-
|
|
168
1017
|
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<div class="docstring">
|
|
175
|
-
<div class="discussion">
|
|
176
|
-
<p class="note private">
|
|
177
|
-
<strong>This constant is part of a private API.</strong>
|
|
178
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
179
|
-
</p>
|
|
1018
|
+
</div>
|
|
1019
|
+
</div>
|
|
1020
|
+
<div class="tags">
|
|
1021
|
+
<p class="tag_title">Parameters:</p>
|
|
1022
|
+
<ul class="param">
|
|
180
1023
|
|
|
181
|
-
<
|
|
1024
|
+
<li>
|
|
182
1025
|
|
|
1026
|
+
<span class='name'>operator</span>
|
|
183
1027
|
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
<div class="tags">
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
</div>
|
|
190
|
-
</dt>
|
|
191
|
-
<dd><pre class="code"><span class='id identifier rubyid_regexp'>regexp</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#INEQUALITY-constant" title="CSVDecision::Matchers::INEQUALITY (constant)">INEQUALITY</a></span></span><span class='rparen'>)</span></pre></dd>
|
|
192
|
-
|
|
193
|
-
<dt id="EQUALS-constant" class="">EQUALS =
|
|
194
|
-
<div class="docstring">
|
|
195
|
-
<div class="discussion">
|
|
196
|
-
<p class="note private">
|
|
197
|
-
<strong>This constant is part of a private API.</strong>
|
|
198
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
199
|
-
</p>
|
|
200
|
-
|
|
201
|
-
<p>Equality, cell constants and functions specified by prefixing the value
|
|
202
|
-
with one of these 3 symbols.</p>
|
|
203
1028
|
|
|
1029
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
204
1030
|
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
<div class="tags">
|
|
208
|
-
|
|
209
1031
|
|
|
210
|
-
</div>
|
|
211
|
-
</dt>
|
|
212
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>==|:=|=</span><span class='tstring_end'>'</span></span></pre></dd>
|
|
213
|
-
|
|
214
|
-
<dt id="EQUALS_RE-constant" class="">EQUALS_RE =
|
|
215
|
-
<div class="docstring">
|
|
216
|
-
<div class="discussion">
|
|
217
|
-
<p class="note private">
|
|
218
|
-
<strong>This constant is part of a private API.</strong>
|
|
219
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
220
|
-
</p>
|
|
221
1032
|
|
|
222
|
-
|
|
1033
|
+
</li>
|
|
223
1034
|
|
|
1035
|
+
</ul>
|
|
224
1036
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
<div class="tags">
|
|
228
|
-
|
|
1037
|
+
<p class="tag_title">Returns:</p>
|
|
1038
|
+
<ul class="return">
|
|
229
1039
|
|
|
230
|
-
|
|
231
|
-
</dt>
|
|
232
|
-
<dd><pre class="code"><span class='id identifier rubyid_regexp'>regexp</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#EQUALS-constant" title="CSVDecision::Matchers::EQUALS (constant)">EQUALS</a></span></span><span class='rparen'>)</span></pre></dd>
|
|
233
|
-
|
|
234
|
-
<dt id="METHOD_NAME_RE-constant" class="">METHOD_NAME_RE =
|
|
235
|
-
<div class="docstring">
|
|
236
|
-
<div class="discussion">
|
|
237
|
-
<p class="note private">
|
|
238
|
-
<strong>This constant is part of a private API.</strong>
|
|
239
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
240
|
-
</p>
|
|
1040
|
+
<li>
|
|
241
1041
|
|
|
242
|
-
<p>Method names are stricter than CSV column names.</p>
|
|
243
1042
|
|
|
1043
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
244
1044
|
|
|
245
|
-
</div>
|
|
246
|
-
</div>
|
|
247
|
-
<div class="tags">
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
</div>
|
|
251
|
-
</dt>
|
|
252
|
-
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A[_a-z][_a-z0-9]*[?!=]?\z</span><span class='regexp_end'>/</span></span></pre></dd>
|
|
253
|
-
|
|
254
|
-
<dt id="NUMERIC-constant" class="">NUMERIC =
|
|
255
|
-
<div class="docstring">
|
|
256
|
-
<div class="discussion">
|
|
257
|
-
<p class="note private">
|
|
258
|
-
<strong>This constant is part of a private API.</strong>
|
|
259
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
260
|
-
</p>
|
|
261
|
-
|
|
262
|
-
<p>Regular expression used to recognise a numeric string with or without a
|
|
263
|
-
decimal point.</p>
|
|
264
1045
|
|
|
265
1046
|
|
|
266
|
-
|
|
267
|
-
</div>
|
|
268
|
-
<div class="tags">
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
</div>
|
|
272
|
-
</dt>
|
|
273
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>[-+]?\d*(?<decimal>\.?)\d*</span><span class='tstring_end'>'</span></span></pre></dd>
|
|
274
|
-
|
|
275
|
-
</dl>
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
281
|
-
<ul class="summary">
|
|
282
|
-
|
|
283
|
-
<li class="public ">
|
|
284
|
-
<span class="summary_signature">
|
|
285
|
-
|
|
286
|
-
<a href="#ins-instance_method" title="#ins (instance method)">#<strong>ins</strong> ⇒ Array<Matchers::Matcher> </a>
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
</span>
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
<span class="note title readonly">readonly</span>
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
<span class="private note title">private</span>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
<span class="summary_desc"><div class='inline'>
|
|
306
|
-
<p>Matchers for the input columns.</p>
|
|
307
|
-
</div></span>
|
|
308
|
-
|
|
309
|
-
</li>
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
<li class="public ">
|
|
313
|
-
<span class="summary_signature">
|
|
314
|
-
|
|
315
|
-
<a href="#outs-instance_method" title="#outs (instance method)">#<strong>outs</strong> ⇒ Array<Matchers::Matcher> </a>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
</span>
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
<span class="note title readonly">readonly</span>
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
<span class="private note title">private</span>
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
<span class="summary_desc"><div class='inline'>
|
|
335
|
-
<p>Matchers for the output columns.</p>
|
|
336
|
-
</div></span>
|
|
337
|
-
|
|
338
|
-
</li>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
</ul>
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
<h2>
|
|
348
|
-
Class Method Summary
|
|
349
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
350
|
-
</h2>
|
|
351
|
-
|
|
352
|
-
<ul class="summary">
|
|
353
|
-
|
|
354
|
-
<li class="public ">
|
|
355
|
-
<span class="summary_signature">
|
|
356
|
-
|
|
357
|
-
<a href="#compare%3F-class_method" title="compare? (class method)">.<strong>compare?</strong>(lhs:, compare:, rhs:) ⇒ nil, Boolean </a>
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
</span>
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
<span class="private note title">private</span>
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
<span class="summary_desc"><div class='inline'>
|
|
372
|
-
<p>Compare one object with another if they both respond to the compare method.</p>
|
|
373
|
-
</div></span>
|
|
374
|
-
|
|
375
|
-
</li>
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
<li class="public ">
|
|
379
|
-
<span class="summary_signature">
|
|
380
|
-
|
|
381
|
-
<a href="#normalize_operator-class_method" title="normalize_operator (class method)">.<strong>normalize_operator</strong>(operator) ⇒ String </a>
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
</span>
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
<span class="private note title">private</span>
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
<span class="summary_desc"><div class='inline'>
|
|
396
|
-
<p>Normalize the operators which are a variation on equals/assignment.</p>
|
|
397
|
-
</div></span>
|
|
398
|
-
|
|
399
|
-
</li>
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
<li class="public ">
|
|
403
|
-
<span class="summary_signature">
|
|
404
|
-
|
|
405
|
-
<a href="#numeric-class_method" title="numeric (class method)">.<strong>numeric</strong>(value) ⇒ nil, ... </a>
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
</span>
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
<span class="private note title">private</span>
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
<span class="summary_desc"><div class='inline'>
|
|
420
|
-
<p>Validate a numeric value and convert it to an Integer or BigDecimal if a
|
|
421
|
-
valid numeric string.</p>
|
|
422
|
-
</div></span>
|
|
423
|
-
|
|
424
|
-
</li>
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
<li class="public ">
|
|
428
|
-
<span class="summary_signature">
|
|
429
|
-
|
|
430
|
-
<a href="#parse-class_method" title="parse (class method)">.<strong>parse</strong>(columns:, matchers:, row:) ⇒ Array<(Array, ScanRow)> </a>
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
</span>
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
<span class="private note title">private</span>
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
<span class="summary_desc"><div class='inline'>
|
|
445
|
-
<p>Parse the supplied input columns for the row supplied using an array of
|
|
446
|
-
matchers.</p>
|
|
447
|
-
</div></span>
|
|
448
|
-
|
|
449
|
-
</li>
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
<li class="public ">
|
|
453
|
-
<span class="summary_signature">
|
|
454
|
-
|
|
455
|
-
<a href="#regexp-class_method" title="regexp (class method)">.<strong>regexp</strong>(value) ⇒ Regexp </a>
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
</span>
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
<span class="private note title">private</span>
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
<span class="summary_desc"><div class='inline'>
|
|
470
|
-
<p>All regular expressions used for matching are anchored inside their own
|
|
471
|
-
non-capturing group.</p>
|
|
472
|
-
</div></span>
|
|
473
|
-
|
|
474
|
-
</li>
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
<li class="public ">
|
|
478
|
-
<span class="summary_signature">
|
|
479
|
-
|
|
480
|
-
<a href="#to_numeric-class_method" title="to_numeric (class method)">.<strong>to_numeric</strong>(value) ⇒ nil, ... </a>
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
</span>
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
<span class="private note title">private</span>
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
<span class="summary_desc"><div class='inline'>
|
|
495
|
-
<p>Convert a numeric string into an Integer or BigDecimal, otherwise return
|
|
496
|
-
nil.</p>
|
|
497
|
-
</div></span>
|
|
498
|
-
|
|
499
|
-
</li>
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
</ul>
|
|
503
|
-
|
|
504
|
-
<h2>
|
|
505
|
-
Instance Method Summary
|
|
506
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
507
|
-
</h2>
|
|
508
|
-
|
|
509
|
-
<ul class="summary">
|
|
510
|
-
|
|
511
|
-
<li class="public ">
|
|
512
|
-
<span class="summary_signature">
|
|
513
|
-
|
|
514
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options) ⇒ Matchers </a>
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
</span>
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
<span class="note title constructor">constructor</span>
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
<span class="private note title">private</span>
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
<span class="summary_desc"><div class='inline'>
|
|
531
|
-
<p>A new instance of Matchers.</p>
|
|
532
|
-
</div></span>
|
|
533
|
-
|
|
534
|
-
</li>
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
<li class="public ">
|
|
538
|
-
<span class="summary_signature">
|
|
539
|
-
|
|
540
|
-
<a href="#parse_ins-instance_method" title="#parse_ins (instance method)">#<strong>parse_ins</strong>(columns:, row:) ⇒ Array<(Array, ScanRow)> </a>
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
</span>
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
<span class="private note title">private</span>
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
<span class="summary_desc"><div class='inline'>
|
|
555
|
-
<p>Parse the row's input columns using the input matchers.</p>
|
|
556
|
-
</div></span>
|
|
557
|
-
|
|
558
|
-
</li>
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
<li class="public ">
|
|
562
|
-
<span class="summary_signature">
|
|
563
|
-
|
|
564
|
-
<a href="#parse_outs-instance_method" title="#parse_outs (instance method)">#<strong>parse_outs</strong>(columns:, row:) ⇒ Array<(Array, ScanRow)> </a>
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
</span>
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
<span class="private note title">private</span>
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
<span class="summary_desc"><div class='inline'>
|
|
579
|
-
<p>Parse the row's output columns using the output matchers.</p>
|
|
580
|
-
</div></span>
|
|
581
|
-
|
|
582
|
-
</li>
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
</ul>
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
<div id="constructor_details" class="method_details_list">
|
|
589
|
-
<h2>Constructor Details</h2>
|
|
590
|
-
|
|
591
|
-
<div class="method_details first">
|
|
592
|
-
<h3 class="signature first" id="initialize-instance_method">
|
|
593
|
-
|
|
594
|
-
#<strong>initialize</strong>(options) ⇒ <tt><span class='object_link'><a href="" title="CSVDecision::Matchers (class)">Matchers</a></span></tt>
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
</h3><div class="docstring">
|
|
601
|
-
<div class="discussion">
|
|
602
|
-
<p class="note private">
|
|
603
|
-
<strong>This method is part of a private API.</strong>
|
|
604
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
605
|
-
</p>
|
|
606
|
-
|
|
607
|
-
<p>Returns a new instance of Matchers</p>
|
|
1047
|
+
</li>
|
|
608
1048
|
|
|
1049
|
+
</ul>
|
|
609
1050
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
<
|
|
613
|
-
|
|
614
|
-
<
|
|
615
|
-
|
|
616
|
-
<li>
|
|
617
|
-
|
|
618
|
-
<span class='name'>options</span>
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
<span class='type'>(<tt>Hash{<span class='object_link'><a href="Matchers/Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span>=>Object}</tt>)</span>
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
—
|
|
626
|
-
<div class='inline'>
|
|
627
|
-
<p>Options hash controlling how the table is parsed and interpreted.</p>
|
|
628
|
-
</div>
|
|
629
|
-
|
|
630
|
-
</li>
|
|
631
|
-
|
|
632
|
-
</ul>
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
</div><table class="source_code">
|
|
636
|
-
<tr>
|
|
637
|
-
<td>
|
|
638
|
-
<pre class="lines">
|
|
1051
|
+
</div>
|
|
1052
|
+
<table class="source_code">
|
|
1053
|
+
<tr>
|
|
1054
|
+
<td>
|
|
1055
|
+
<pre class="lines">
|
|
639
1056
|
|
|
640
1057
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
<td>
|
|
648
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 167</span>
|
|
1058
|
+
95
|
|
1059
|
+
96
|
|
1060
|
+
97</pre>
|
|
1061
|
+
</td>
|
|
1062
|
+
<td>
|
|
1063
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 95</span>
|
|
649
1064
|
|
|
650
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
651
|
-
<span class='
|
|
652
|
-
<span class='ivar'>@ins</span> <span class='op'>=</span> <span class='id identifier rubyid_matchers'>matchers</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:ins?</span><span class='rparen'>)</span>
|
|
653
|
-
<span class='ivar'>@outs</span> <span class='op'>=</span> <span class='id identifier rubyid_matchers'>matchers</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:outs?</span><span class='rparen'>)</span>
|
|
1065
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_normalize_operator'>normalize_operator</span><span class='lparen'>(</span><span class='id identifier rubyid_operator'>operator</span><span class='rparen'>)</span>
|
|
1066
|
+
<span class='const'><span class='object_link'><a href="#EQUALS_RE-constant" title="CSVDecision2::Matchers::EQUALS_RE (constant)">EQUALS_RE</a></span></span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_operator'>operator</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>==</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='id identifier rubyid_operator'>operator</span>
|
|
654
1067
|
<span class='kw'>end</span></pre>
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
</table>
|
|
658
|
-
</div>
|
|
659
|
-
|
|
660
|
-
</div>
|
|
661
|
-
|
|
662
|
-
<div id="instance_attr_details" class="attr_details">
|
|
663
|
-
<h2>Instance Attribute Details</h2>
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
<span id=""></span>
|
|
667
|
-
<div class="method_details first">
|
|
668
|
-
<h3 class="signature first" id="ins-instance_method">
|
|
669
|
-
|
|
670
|
-
#<strong>ins</strong> ⇒ <tt>Array<<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt> <span class="extras">(readonly)</span>
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
</h3><div class="docstring">
|
|
677
|
-
<div class="discussion">
|
|
678
|
-
<p class="note private">
|
|
679
|
-
<strong>This method is part of a private API.</strong>
|
|
680
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
681
|
-
</p>
|
|
682
|
-
|
|
683
|
-
<p>Returns Matchers for the input columns.</p>
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
</div>
|
|
687
|
-
</div>
|
|
688
|
-
<div class="tags">
|
|
689
|
-
|
|
690
|
-
<p class="tag_title">Returns:</p>
|
|
691
|
-
<ul class="return">
|
|
692
|
-
|
|
693
|
-
<li>
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
<span class='type'>(<tt>Array<<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt>)</span>
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
—
|
|
701
|
-
<div class='inline'>
|
|
702
|
-
<p>Matchers for the input columns.</p>
|
|
703
|
-
</div>
|
|
704
|
-
|
|
705
|
-
</li>
|
|
706
|
-
|
|
707
|
-
</ul>
|
|
708
|
-
|
|
709
|
-
</div><table class="source_code">
|
|
710
|
-
<tr>
|
|
711
|
-
<td>
|
|
712
|
-
<pre class="lines">
|
|
1068
|
+
</td>
|
|
1069
|
+
</tr>
|
|
1070
|
+
</table>
|
|
1071
|
+
</div>
|
|
713
1072
|
|
|
1073
|
+
<div class="method_details ">
|
|
1074
|
+
<h3 class="signature " id="numeric-class_method">
|
|
714
1075
|
|
|
715
|
-
|
|
716
|
-
162
|
|
717
|
-
163</pre>
|
|
718
|
-
</td>
|
|
719
|
-
<td>
|
|
720
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 161</span>
|
|
1076
|
+
.<strong>numeric</strong>(value) ⇒ <tt>nil</tt>, ...
|
|
721
1077
|
|
|
722
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span>
|
|
723
|
-
<span class='ivar'>@ins</span>
|
|
724
|
-
<span class='kw'>end</span></pre>
|
|
725
|
-
</td>
|
|
726
|
-
</tr>
|
|
727
|
-
</table>
|
|
728
|
-
</div>
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
<span id=""></span>
|
|
732
|
-
<div class="method_details ">
|
|
733
|
-
<h3 class="signature " id="outs-instance_method">
|
|
734
|
-
|
|
735
|
-
#<strong>outs</strong> ⇒ <tt>Array<<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt> <span class="extras">(readonly)</span>
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
</h3><div class="docstring">
|
|
742
|
-
<div class="discussion">
|
|
743
|
-
<p class="note private">
|
|
744
|
-
<strong>This method is part of a private API.</strong>
|
|
745
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
746
|
-
</p>
|
|
747
|
-
|
|
748
|
-
<p>Returns Matchers for the output columns.</p>
|
|
749
1078
|
|
|
750
1079
|
|
|
751
|
-
</div>
|
|
752
|
-
</div>
|
|
753
|
-
<div class="tags">
|
|
754
|
-
|
|
755
|
-
<p class="tag_title">Returns:</p>
|
|
756
|
-
<ul class="return">
|
|
757
|
-
|
|
758
|
-
<li>
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
<span class='type'>(<tt>Array<<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt>)</span>
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
—
|
|
766
|
-
<div class='inline'>
|
|
767
|
-
<p>Matchers for the output columns.</p>
|
|
768
|
-
</div>
|
|
769
|
-
|
|
770
|
-
</li>
|
|
771
|
-
|
|
772
|
-
</ul>
|
|
773
|
-
|
|
774
|
-
</div><table class="source_code">
|
|
775
|
-
<tr>
|
|
776
|
-
<td>
|
|
777
|
-
<pre class="lines">
|
|
778
1080
|
|
|
779
1081
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
1082
|
+
</h3>
|
|
1083
|
+
<div class="docstring">
|
|
1084
|
+
<div class="discussion">
|
|
1085
|
+
<p class="note private">
|
|
1086
|
+
<strong>This method is part of a private API.</strong>
|
|
1087
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1088
|
+
</p>
|
|
786
1089
|
|
|
787
|
-
<
|
|
788
|
-
|
|
789
|
-
<span class='kw'>end</span></pre>
|
|
790
|
-
</td>
|
|
791
|
-
</tr>
|
|
792
|
-
</table>
|
|
793
|
-
</div>
|
|
794
|
-
|
|
795
|
-
</div>
|
|
1090
|
+
<p>Validate a numeric value and convert it to an Integer or BigDecimal if a
|
|
1091
|
+
valid numeric string.</p>
|
|
796
1092
|
|
|
797
1093
|
|
|
798
|
-
|
|
799
|
-
|
|
1094
|
+
</div>
|
|
1095
|
+
</div>
|
|
1096
|
+
<div class="tags">
|
|
1097
|
+
<p class="tag_title">Parameters:</p>
|
|
1098
|
+
<ul class="param">
|
|
800
1099
|
|
|
801
|
-
|
|
802
|
-
<div class="method_details first">
|
|
803
|
-
<h3 class="signature first" id="compare?-class_method">
|
|
804
|
-
|
|
805
|
-
.<strong>compare?</strong>(lhs:, compare:, rhs:) ⇒ <tt>nil</tt>, <tt>Boolean</tt>
|
|
806
|
-
|
|
1100
|
+
<li>
|
|
807
1101
|
|
|
808
|
-
|
|
1102
|
+
<span class='name'>value</span>
|
|
809
1103
|
|
|
810
|
-
|
|
811
|
-
</h3><div class="docstring">
|
|
812
|
-
<div class="discussion">
|
|
813
|
-
<p class="note private">
|
|
814
|
-
<strong>This method is part of a private API.</strong>
|
|
815
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
816
|
-
</p>
|
|
817
1104
|
|
|
818
|
-
<
|
|
1105
|
+
<span class='type'>(<tt>nil</tt>, <tt>String</tt>, <tt>Integer</tt>, <tt>BigDecimal</tt>)</span>
|
|
819
1106
|
|
|
820
1107
|
|
|
821
|
-
</div>
|
|
822
|
-
</div>
|
|
823
|
-
<div class="tags">
|
|
824
|
-
<p class="tag_title">Parameters:</p>
|
|
825
|
-
<ul class="param">
|
|
826
|
-
|
|
827
|
-
<li>
|
|
828
|
-
|
|
829
|
-
<span class='name'>lhs</span>
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
<span class='type'>(<tt>Object</tt>)</span>
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
</li>
|
|
837
|
-
|
|
838
|
-
<li>
|
|
839
|
-
|
|
840
|
-
<span class='name'>compare</span>
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
<span class='type'>(<tt>Object</tt>)</span>
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
</li>
|
|
848
|
-
|
|
849
|
-
<li>
|
|
850
|
-
|
|
851
|
-
<span class='name'>rhs</span>
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
<span class='type'>(<tt>Object</tt>)</span>
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
</li>
|
|
859
|
-
|
|
860
|
-
</ul>
|
|
861
|
-
|
|
862
|
-
<p class="tag_title">Returns:</p>
|
|
863
|
-
<ul class="return">
|
|
864
|
-
|
|
865
|
-
<li>
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
<span class='type'>(<tt>nil</tt>, <tt>Boolean</tt>)</span>
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
</li>
|
|
873
|
-
|
|
874
|
-
</ul>
|
|
875
|
-
|
|
876
|
-
</div><table class="source_code">
|
|
877
|
-
<tr>
|
|
878
|
-
<td>
|
|
879
|
-
<pre class="lines">
|
|
880
1108
|
|
|
1109
|
+
</li>
|
|
881
1110
|
|
|
882
|
-
|
|
883
|
-
134
|
|
884
|
-
135
|
|
885
|
-
136
|
|
886
|
-
137
|
|
887
|
-
138
|
|
888
|
-
139</pre>
|
|
889
|
-
</td>
|
|
890
|
-
<td>
|
|
891
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 133</span>
|
|
1111
|
+
</ul>
|
|
892
1112
|
|
|
893
|
-
<
|
|
894
|
-
|
|
895
|
-
</span> <span class='comment'># compare method?
|
|
896
|
-
</span> <span class='kw'>return</span> <span class='id identifier rubyid_lhs'>lhs</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_compare'>compare</span><span class='comma'>,</span> <span class='id identifier rubyid_rhs'>rhs</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_lhs'>lhs</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='id identifier rubyid_rhs'>rhs</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_rhs'>rhs</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_compare'>compare</span><span class='rparen'>)</span>
|
|
1113
|
+
<p class="tag_title">Returns:</p>
|
|
1114
|
+
<ul class="return">
|
|
897
1115
|
|
|
898
|
-
|
|
899
|
-
<span class='kw'>end</span></pre>
|
|
900
|
-
</td>
|
|
901
|
-
</tr>
|
|
902
|
-
</table>
|
|
903
|
-
</div>
|
|
904
|
-
|
|
905
|
-
<div class="method_details ">
|
|
906
|
-
<h3 class="signature " id="normalize_operator-class_method">
|
|
907
|
-
|
|
908
|
-
.<strong>normalize_operator</strong>(operator) ⇒ <tt>String</tt>
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
</h3><div class="docstring">
|
|
915
|
-
<div class="discussion">
|
|
916
|
-
<p class="note private">
|
|
917
|
-
<strong>This method is part of a private API.</strong>
|
|
918
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
919
|
-
</p>
|
|
920
|
-
|
|
921
|
-
<p>Normalize the operators which are a variation on equals/assignment.</p>
|
|
1116
|
+
<li>
|
|
922
1117
|
|
|
923
1118
|
|
|
924
|
-
|
|
925
|
-
</div>
|
|
926
|
-
<div class="tags">
|
|
927
|
-
<p class="tag_title">Parameters:</p>
|
|
928
|
-
<ul class="param">
|
|
929
|
-
|
|
930
|
-
<li>
|
|
931
|
-
|
|
932
|
-
<span class='name'>operator</span>
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
<span class='type'>(<tt>String</tt>)</span>
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
</li>
|
|
940
|
-
|
|
941
|
-
</ul>
|
|
942
|
-
|
|
943
|
-
<p class="tag_title">Returns:</p>
|
|
944
|
-
<ul class="return">
|
|
945
|
-
|
|
946
|
-
<li>
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
<span class='type'>(<tt>String</tt>)</span>
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
</li>
|
|
954
|
-
|
|
955
|
-
</ul>
|
|
956
|
-
|
|
957
|
-
</div><table class="source_code">
|
|
958
|
-
<tr>
|
|
959
|
-
<td>
|
|
960
|
-
<pre class="lines">
|
|
1119
|
+
<span class='type'>(<tt>nil</tt>, <tt>Integer</tt>, <tt>BigDecimal</tt>)</span>
|
|
961
1120
|
|
|
962
1121
|
|
|
963
|
-
95
|
|
964
|
-
96
|
|
965
|
-
97</pre>
|
|
966
|
-
</td>
|
|
967
|
-
<td>
|
|
968
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 95</span>
|
|
969
1122
|
|
|
970
|
-
|
|
971
|
-
<span class='const'><span class='object_link'><a href="#EQUALS_RE-constant" title="CSVDecision::Matchers::EQUALS_RE (constant)">EQUALS_RE</a></span></span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_operator'>operator</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>==</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='id identifier rubyid_operator'>operator</span>
|
|
972
|
-
<span class='kw'>end</span></pre>
|
|
973
|
-
</td>
|
|
974
|
-
</tr>
|
|
975
|
-
</table>
|
|
976
|
-
</div>
|
|
977
|
-
|
|
978
|
-
<div class="method_details ">
|
|
979
|
-
<h3 class="signature " id="numeric-class_method">
|
|
980
|
-
|
|
981
|
-
.<strong>numeric</strong>(value) ⇒ <tt>nil</tt>, ...
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
</h3><div class="docstring">
|
|
988
|
-
<div class="discussion">
|
|
989
|
-
<p class="note private">
|
|
990
|
-
<strong>This method is part of a private API.</strong>
|
|
991
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
992
|
-
</p>
|
|
993
|
-
|
|
994
|
-
<p>Validate a numeric value and convert it to an Integer or BigDecimal if a
|
|
995
|
-
valid numeric string.</p>
|
|
1123
|
+
</li>
|
|
996
1124
|
|
|
1125
|
+
</ul>
|
|
997
1126
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
<
|
|
1001
|
-
|
|
1002
|
-
<
|
|
1003
|
-
|
|
1004
|
-
<li>
|
|
1005
|
-
|
|
1006
|
-
<span class='name'>value</span>
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
<span class='type'>(<tt>nil</tt>, <tt>String</tt>, <tt>Integer</tt>, <tt>BigDecimal</tt>)</span>
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
</li>
|
|
1014
|
-
|
|
1015
|
-
</ul>
|
|
1016
|
-
|
|
1017
|
-
<p class="tag_title">Returns:</p>
|
|
1018
|
-
<ul class="return">
|
|
1019
|
-
|
|
1020
|
-
<li>
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
<span class='type'>(<tt>nil</tt>, <tt>Integer</tt>, <tt>BigDecimal</tt>)</span>
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
</li>
|
|
1028
|
-
|
|
1029
|
-
</ul>
|
|
1030
|
-
|
|
1031
|
-
</div><table class="source_code">
|
|
1032
|
-
<tr>
|
|
1033
|
-
<td>
|
|
1034
|
-
<pre class="lines">
|
|
1127
|
+
</div>
|
|
1128
|
+
<table class="source_code">
|
|
1129
|
+
<tr>
|
|
1130
|
+
<td>
|
|
1131
|
+
<pre class="lines">
|
|
1035
1132
|
|
|
1036
1133
|
|
|
1037
1134
|
109
|
|
@@ -1040,9 +1137,9 @@ valid numeric string.</p>
|
|
|
1040
1137
|
112
|
|
1041
1138
|
113
|
|
1042
1139
|
114</pre>
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1140
|
+
</td>
|
|
1141
|
+
<td>
|
|
1142
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 109</span>
|
|
1046
1143
|
|
|
1047
1144
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
1048
1145
|
<span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>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> <span class='op'>||</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>BigDecimal</span><span class='rparen'>)</span>
|
|
@@ -1050,105 +1147,111 @@ valid numeric string.</p>
|
|
|
1050
1147
|
|
|
1051
1148
|
<span class='id identifier rubyid_to_numeric'>to_numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
1052
1149
|
<span class='kw'>end</span></pre>
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
</table>
|
|
1056
|
-
</div>
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1150
|
+
</td>
|
|
1151
|
+
</tr>
|
|
1152
|
+
</table>
|
|
1153
|
+
</div>
|
|
1154
|
+
|
|
1155
|
+
<div class="method_details ">
|
|
1156
|
+
<h3 class="signature " id="parse-class_method">
|
|
1157
|
+
|
|
1158
|
+
.<strong>parse</strong>(columns:, matchers:, row:) ⇒ <tt>Array<(Array, <span
|
|
1159
|
+
class='object_link'><a href="ScanRow.html"
|
|
1160
|
+
title="CSVDecision2::ScanRow (class)">ScanRow</a></span>)></tt>
|
|
1161
|
+
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
</h3>
|
|
1167
|
+
<div class="docstring">
|
|
1168
|
+
<div class="discussion">
|
|
1169
|
+
<p class="note private">
|
|
1170
|
+
<strong>This method is part of a private API.</strong>
|
|
1171
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1172
|
+
</p>
|
|
1173
|
+
|
|
1174
|
+
<p>Parse the supplied input columns for the row supplied using an array of
|
|
1175
|
+
matchers.</p>
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
</div>
|
|
1179
|
+
</div>
|
|
1180
|
+
<div class="tags">
|
|
1181
|
+
<p class="tag_title">Parameters:</p>
|
|
1182
|
+
<ul class="param">
|
|
1183
|
+
|
|
1184
|
+
<li>
|
|
1185
|
+
|
|
1186
|
+
<span class='name'>columns</span>
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
<span class='type'>(<tt>Hash{Integer=>Columns::Entry}</tt>)</span>
|
|
1076
1190
|
|
|
1077
1191
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
<div class=
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
</
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
<
|
|
1123
|
-
</
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
<p
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
<p>Used to scan a table row against an input hash for matches.</p>
|
|
1142
|
-
</div>
|
|
1143
|
-
|
|
1144
|
-
</li>
|
|
1145
|
-
|
|
1146
|
-
</ul>
|
|
1147
|
-
|
|
1148
|
-
</div><table class="source_code">
|
|
1149
|
-
<tr>
|
|
1150
|
-
<td>
|
|
1151
|
-
<pre class="lines">
|
|
1192
|
+
|
|
1193
|
+
—
|
|
1194
|
+
<div class='inline'>
|
|
1195
|
+
<p>Input columns hash.</p>
|
|
1196
|
+
</div>
|
|
1197
|
+
|
|
1198
|
+
</li>
|
|
1199
|
+
|
|
1200
|
+
<li>
|
|
1201
|
+
|
|
1202
|
+
<span class='name'>matchers</span>
|
|
1203
|
+
|
|
1204
|
+
|
|
1205
|
+
<span class='type'>(<tt>Array<<span class='object_link'><a href="Matchers/Matcher.html"
|
|
1206
|
+
title="CSVDecision2::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt>)</span>
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
</li>
|
|
1211
|
+
|
|
1212
|
+
<li>
|
|
1213
|
+
|
|
1214
|
+
<span class='name'>row</span>
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
—
|
|
1222
|
+
<div class='inline'>
|
|
1223
|
+
<p>Data row being parsed.</p>
|
|
1224
|
+
</div>
|
|
1225
|
+
|
|
1226
|
+
</li>
|
|
1227
|
+
|
|
1228
|
+
</ul>
|
|
1229
|
+
|
|
1230
|
+
<p class="tag_title">Returns:</p>
|
|
1231
|
+
<ul class="return">
|
|
1232
|
+
|
|
1233
|
+
<li>
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
<span class='type'>(<tt>Array<(Array, <span class='object_link'><a href="ScanRow.html"
|
|
1237
|
+
title="CSVDecision2::ScanRow (class)">ScanRow</a></span>)></tt>)</span>
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
—
|
|
1242
|
+
<div class='inline'>
|
|
1243
|
+
<p>Used to scan a table row against an input hash for matches.</p>
|
|
1244
|
+
</div>
|
|
1245
|
+
|
|
1246
|
+
</li>
|
|
1247
|
+
|
|
1248
|
+
</ul>
|
|
1249
|
+
|
|
1250
|
+
</div>
|
|
1251
|
+
<table class="source_code">
|
|
1252
|
+
<tr>
|
|
1253
|
+
<td>
|
|
1254
|
+
<pre class="lines">
|
|
1152
1255
|
|
|
1153
1256
|
|
|
1154
1257
|
147
|
|
@@ -1163,14 +1266,14 @@ matchers.</p>
|
|
|
1163
1266
|
156
|
|
1164
1267
|
157
|
|
1165
1268
|
158</pre>
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1269
|
+
</td>
|
|
1270
|
+
<td>
|
|
1271
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 147</span>
|
|
1169
1272
|
|
|
1170
1273
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>matchers:</span><span class='comma'>,</span> <span class='label'>row:</span><span class='rparen'>)</span>
|
|
1171
1274
|
<span class='comment'># Build an array of column indexes requiring simple constant matches,
|
|
1172
1275
|
</span> <span class='comment'># and a second array of columns requiring special matchers.
|
|
1173
|
-
</span> <span class='id identifier rubyid_scan_row'>scan_row</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ScanRow.html" title="
|
|
1276
|
+
</span> <span class='id identifier rubyid_scan_row'>scan_row</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ScanRow.html" title="CSVDecision2::ScanRow (class)">ScanRow</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ScanRow.html#initialize-instance_method" title="CSVDecision2::ScanRow#initialize (method)">new</a></span></span>
|
|
1174
1277
|
|
|
1175
1278
|
<span class='comment'># Scan the columns in the data row, and build an object to scan this row against
|
|
1176
1279
|
</span> <span class='comment'># an input hash.
|
|
@@ -1179,152 +1282,156 @@ matchers.</p>
|
|
|
1179
1282
|
|
|
1180
1283
|
<span class='lbracket'>[</span><span class='id identifier rubyid_row'>row</span><span class='comma'>,</span> <span class='id identifier rubyid_scan_row'>scan_row</span><span class='rbracket'>]</span>
|
|
1181
1284
|
<span class='kw'>end</span></pre>
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
</table>
|
|
1185
|
-
</div>
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
</h3><div class="docstring">
|
|
1197
|
-
<div class="discussion">
|
|
1198
|
-
<p class="note private">
|
|
1199
|
-
<strong>This method is part of a private API.</strong>
|
|
1200
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1201
|
-
</p>
|
|
1202
|
-
|
|
1203
|
-
<p>All regular expressions used for matching are anchored inside their own
|
|
1204
|
-
non-capturing group.</p>
|
|
1285
|
+
</td>
|
|
1286
|
+
</tr>
|
|
1287
|
+
</table>
|
|
1288
|
+
</div>
|
|
1289
|
+
|
|
1290
|
+
<div class="method_details ">
|
|
1291
|
+
<h3 class="signature " id="regexp-class_method">
|
|
1292
|
+
|
|
1293
|
+
.<strong>regexp</strong>(value) ⇒ <tt>Regexp</tt>
|
|
1294
|
+
|
|
1205
1295
|
|
|
1206
1296
|
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
<
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
<p>
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
</
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
<
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
</h3>
|
|
1300
|
+
<div class="docstring">
|
|
1301
|
+
<div class="discussion">
|
|
1302
|
+
<p class="note private">
|
|
1303
|
+
<strong>This method is part of a private API.</strong>
|
|
1304
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1305
|
+
</p>
|
|
1306
|
+
|
|
1307
|
+
<p>All regular expressions used for matching are anchored inside their own
|
|
1308
|
+
non-capturing group.</p>
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
</div>
|
|
1312
|
+
</div>
|
|
1313
|
+
<div class="tags">
|
|
1314
|
+
<p class="tag_title">Parameters:</p>
|
|
1315
|
+
<ul class="param">
|
|
1316
|
+
|
|
1317
|
+
<li>
|
|
1318
|
+
|
|
1319
|
+
<span class='name'>value</span>
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
—
|
|
1327
|
+
<div class='inline'>
|
|
1328
|
+
<p>String used to form an anchored regular expression.</p>
|
|
1329
|
+
</div>
|
|
1330
|
+
|
|
1331
|
+
</li>
|
|
1332
|
+
|
|
1333
|
+
</ul>
|
|
1334
|
+
|
|
1335
|
+
<p class="tag_title">Returns:</p>
|
|
1336
|
+
<ul class="return">
|
|
1337
|
+
|
|
1338
|
+
<li>
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
<span class='type'>(<tt>Regexp</tt>)</span>
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
—
|
|
1346
|
+
<div class='inline'>
|
|
1347
|
+
<p>Anchored, frozen regular expression.</p>
|
|
1348
|
+
</div>
|
|
1349
|
+
|
|
1350
|
+
</li>
|
|
1351
|
+
|
|
1352
|
+
</ul>
|
|
1353
|
+
|
|
1354
|
+
</div>
|
|
1355
|
+
<table class="source_code">
|
|
1356
|
+
<tr>
|
|
1357
|
+
<td>
|
|
1358
|
+
<pre class="lines">
|
|
1254
1359
|
|
|
1255
1360
|
|
|
1256
1361
|
71
|
|
1257
1362
|
72
|
|
1258
1363
|
73</pre>
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1364
|
+
</td>
|
|
1365
|
+
<td>
|
|
1366
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 71</span>
|
|
1262
1367
|
|
|
1263
1368
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_regexp'>regexp</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
1264
1369
|
<span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\A(?:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>)\\z</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
|
1265
1370
|
<span class='kw'>end</span></pre>
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
</table>
|
|
1269
|
-
</div>
|
|
1270
|
-
|
|
1271
|
-
<div class="method_details ">
|
|
1272
|
-
<h3 class="signature " id="to_numeric-class_method">
|
|
1273
|
-
|
|
1274
|
-
.<strong>to_numeric</strong>(value) ⇒ <tt>nil</tt>, ...
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
</h3><div class="docstring">
|
|
1281
|
-
<div class="discussion">
|
|
1282
|
-
<p class="note private">
|
|
1283
|
-
<strong>This method is part of a private API.</strong>
|
|
1284
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1285
|
-
</p>
|
|
1286
|
-
|
|
1287
|
-
<p>Convert a numeric string into an Integer or BigDecimal, otherwise return
|
|
1288
|
-
nil.</p>
|
|
1371
|
+
</td>
|
|
1372
|
+
</tr>
|
|
1373
|
+
</table>
|
|
1374
|
+
</div>
|
|
1289
1375
|
|
|
1376
|
+
<div class="method_details ">
|
|
1377
|
+
<h3 class="signature " id="to_numeric-class_method">
|
|
1378
|
+
|
|
1379
|
+
.<strong>to_numeric</strong>(value) ⇒ <tt>nil</tt>, ...
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
</h3>
|
|
1386
|
+
<div class="docstring">
|
|
1387
|
+
<div class="discussion">
|
|
1388
|
+
<p class="note private">
|
|
1389
|
+
<strong>This method is part of a private API.</strong>
|
|
1390
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1391
|
+
</p>
|
|
1392
|
+
|
|
1393
|
+
<p>Convert a numeric string into an Integer or BigDecimal, otherwise return
|
|
1394
|
+
nil.</p>
|
|
1290
1395
|
|
|
1291
|
-
|
|
1292
|
-
</div>
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
<
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
<
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1396
|
+
|
|
1397
|
+
</div>
|
|
1398
|
+
</div>
|
|
1399
|
+
<div class="tags">
|
|
1400
|
+
<p class="tag_title">Parameters:</p>
|
|
1401
|
+
<ul class="param">
|
|
1402
|
+
|
|
1403
|
+
<li>
|
|
1404
|
+
|
|
1405
|
+
<span class='name'>value</span>
|
|
1406
|
+
|
|
1407
|
+
|
|
1408
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
|
|
1412
|
+
</li>
|
|
1413
|
+
|
|
1414
|
+
</ul>
|
|
1415
|
+
|
|
1416
|
+
<p class="tag_title">Returns:</p>
|
|
1417
|
+
<ul class="return">
|
|
1418
|
+
|
|
1419
|
+
<li>
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
<span class='type'>(<tt>nil</tt>, <tt>Integer</tt>, <tt>BigDecimal</tt>)</span>
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
</li>
|
|
1427
|
+
|
|
1428
|
+
</ul>
|
|
1429
|
+
|
|
1430
|
+
</div>
|
|
1431
|
+
<table class="source_code">
|
|
1432
|
+
<tr>
|
|
1433
|
+
<td>
|
|
1434
|
+
<pre class="lines">
|
|
1328
1435
|
|
|
1329
1436
|
|
|
1330
1437
|
120
|
|
@@ -1333,9 +1440,9 @@ nil.</p>
|
|
|
1333
1440
|
123
|
|
1334
1441
|
124
|
|
1335
1442
|
125</pre>
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1443
|
+
</td>
|
|
1444
|
+
<td>
|
|
1445
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 120</span>
|
|
1339
1446
|
|
|
1340
1447
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_numeric'>to_numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
1341
1448
|
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='id identifier rubyid_match'>match</span> <span class='op'>=</span> <span class='const'>NUMERIC_RE</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
@@ -1343,225 +1450,234 @@ nil.</p>
|
|
|
1343
1450
|
<span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='kw'>if</span> <span class='id identifier rubyid_match'>match</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>decimal</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
|
1344
1451
|
<span class='const'>BigDecimal</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
1345
1452
|
<span class='kw'>end</span></pre>
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
</table>
|
|
1349
|
-
</div>
|
|
1350
|
-
|
|
1351
|
-
|
|
1453
|
+
</td>
|
|
1454
|
+
</tr>
|
|
1455
|
+
</table>
|
|
1456
|
+
</div>
|
|
1457
|
+
|
|
1458
|
+
</div>
|
|
1352
1459
|
|
|
1353
|
-
|
|
1354
|
-
|
|
1460
|
+
<div id="instance_method_details" class="method_details_list">
|
|
1461
|
+
<h2>Instance Method Details</h2>
|
|
1355
1462
|
|
|
1356
|
-
|
|
1357
|
-
<div class="method_details first">
|
|
1358
|
-
<h3 class="signature first" id="parse_ins-instance_method">
|
|
1359
|
-
|
|
1360
|
-
#<strong>parse_ins</strong>(columns:, row:) ⇒ <tt>Array<(Array, <span class='object_link'><a href="ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>)></tt>
|
|
1361
|
-
|
|
1362
1463
|
|
|
1363
|
-
|
|
1464
|
+
<div class="method_details first">
|
|
1465
|
+
<h3 class="signature first" id="parse_ins-instance_method">
|
|
1364
1466
|
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
<div class="discussion">
|
|
1368
|
-
<p class="note private">
|
|
1369
|
-
<strong>This method is part of a private API.</strong>
|
|
1370
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1371
|
-
</p>
|
|
1467
|
+
#<strong>parse_ins</strong>(columns:, row:) ⇒ <tt>Array<(Array, <span class='object_link'><a
|
|
1468
|
+
href="ScanRow.html" title="CSVDecision2::ScanRow (class)">ScanRow</a></span>)></tt>
|
|
1372
1469
|
|
|
1373
|
-
<p>Parse the row's input columns using the input matchers.</p>
|
|
1374
1470
|
|
|
1375
1471
|
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
<
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
<
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
<
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1472
|
+
|
|
1473
|
+
|
|
1474
|
+
</h3>
|
|
1475
|
+
<div class="docstring">
|
|
1476
|
+
<div class="discussion">
|
|
1477
|
+
<p class="note private">
|
|
1478
|
+
<strong>This method is part of a private API.</strong>
|
|
1479
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1480
|
+
</p>
|
|
1481
|
+
|
|
1482
|
+
<p>Parse the row's input columns using the input matchers.</p>
|
|
1483
|
+
|
|
1484
|
+
|
|
1485
|
+
</div>
|
|
1486
|
+
</div>
|
|
1487
|
+
<div class="tags">
|
|
1488
|
+
<p class="tag_title">Parameters:</p>
|
|
1489
|
+
<ul class="param">
|
|
1490
|
+
|
|
1491
|
+
<li>
|
|
1492
|
+
|
|
1493
|
+
<span class='name'>columns</span>
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
<span class='type'>(<tt>Hash{Integer=>Columns::Entry}</tt>)</span>
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
—
|
|
1501
|
+
<div class='inline'>
|
|
1502
|
+
<p>Input columns hash.</p>
|
|
1503
|
+
</div>
|
|
1504
|
+
|
|
1505
|
+
</li>
|
|
1506
|
+
|
|
1507
|
+
<li>
|
|
1508
|
+
|
|
1509
|
+
<span class='name'>row</span>
|
|
1510
|
+
|
|
1511
|
+
|
|
1512
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
|
|
1516
|
+
—
|
|
1517
|
+
<div class='inline'>
|
|
1518
|
+
<p>Data row being parsed.</p>
|
|
1519
|
+
</div>
|
|
1520
|
+
|
|
1521
|
+
</li>
|
|
1522
|
+
|
|
1523
|
+
</ul>
|
|
1524
|
+
|
|
1525
|
+
<p class="tag_title">Returns:</p>
|
|
1526
|
+
<ul class="return">
|
|
1527
|
+
|
|
1528
|
+
<li>
|
|
1529
|
+
|
|
1530
|
+
|
|
1531
|
+
<span class='type'>(<tt>Array<(Array, <span class='object_link'><a href="ScanRow.html"
|
|
1532
|
+
title="CSVDecision2::ScanRow (class)">ScanRow</a></span>)></tt>)</span>
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
—
|
|
1537
|
+
<div class='inline'>
|
|
1538
|
+
<p>Used to scan a table row against an input hash for matches.</p>
|
|
1539
|
+
</div>
|
|
1540
|
+
|
|
1541
|
+
</li>
|
|
1542
|
+
|
|
1543
|
+
</ul>
|
|
1544
|
+
|
|
1545
|
+
</div>
|
|
1546
|
+
<table class="source_code">
|
|
1547
|
+
<tr>
|
|
1548
|
+
<td>
|
|
1549
|
+
<pre class="lines">
|
|
1439
1550
|
|
|
1440
1551
|
|
|
1441
1552
|
178
|
|
1442
1553
|
179
|
|
1443
1554
|
180</pre>
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1555
|
+
</td>
|
|
1556
|
+
<td>
|
|
1557
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 178</span>
|
|
1447
1558
|
|
|
1448
1559
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse_ins'>parse_ins</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>row:</span><span class='rparen'>)</span>
|
|
1449
|
-
<span class='const'><span class='object_link'><a href="" title="
|
|
1560
|
+
<span class='const'><span class='object_link'><a href="" title="CSVDecision2::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="#parse-class_method" title="CSVDecision2::Matchers.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='label'>columns:</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='label'>matchers:</span> <span class='ivar'>@ins</span><span class='comma'>,</span> <span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
|
|
1450
1561
|
<span class='kw'>end</span></pre>
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
</table>
|
|
1454
|
-
</div>
|
|
1455
|
-
|
|
1456
|
-
<div class="method_details ">
|
|
1457
|
-
<h3 class="signature " id="parse_outs-instance_method">
|
|
1458
|
-
|
|
1459
|
-
#<strong>parse_outs</strong>(columns:, row:) ⇒ <tt>Array<(Array, <span class='object_link'><a href="ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>)></tt>
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
</h3><div class="docstring">
|
|
1466
|
-
<div class="discussion">
|
|
1467
|
-
<p class="note private">
|
|
1468
|
-
<strong>This method is part of a private API.</strong>
|
|
1469
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1470
|
-
</p>
|
|
1471
|
-
|
|
1472
|
-
<p>Parse the row's output columns using the output matchers.</p>
|
|
1562
|
+
</td>
|
|
1563
|
+
</tr>
|
|
1564
|
+
</table>
|
|
1565
|
+
</div>
|
|
1473
1566
|
|
|
1567
|
+
<div class="method_details ">
|
|
1568
|
+
<h3 class="signature " id="parse_outs-instance_method">
|
|
1474
1569
|
|
|
1475
|
-
|
|
1476
|
-
</
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
</div>
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
</
|
|
1514
|
-
|
|
1515
|
-
<
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1570
|
+
#<strong>parse_outs</strong>(columns:, row:) ⇒ <tt>Array<(Array, <span class='object_link'><a
|
|
1571
|
+
href="ScanRow.html" title="CSVDecision2::ScanRow (class)">ScanRow</a></span>)></tt>
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
</h3>
|
|
1578
|
+
<div class="docstring">
|
|
1579
|
+
<div class="discussion">
|
|
1580
|
+
<p class="note private">
|
|
1581
|
+
<strong>This method is part of a private API.</strong>
|
|
1582
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
1583
|
+
</p>
|
|
1584
|
+
|
|
1585
|
+
<p>Parse the row's output columns using the output matchers.</p>
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
</div>
|
|
1589
|
+
</div>
|
|
1590
|
+
<div class="tags">
|
|
1591
|
+
<p class="tag_title">Parameters:</p>
|
|
1592
|
+
<ul class="param">
|
|
1593
|
+
|
|
1594
|
+
<li>
|
|
1595
|
+
|
|
1596
|
+
<span class='name'>columns</span>
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
<span class='type'>(<tt>Hash{Integer=>Columns::Entry}</tt>)</span>
|
|
1600
|
+
|
|
1601
|
+
|
|
1602
|
+
|
|
1603
|
+
—
|
|
1604
|
+
<div class='inline'>
|
|
1605
|
+
<p>Input columns hash.</p>
|
|
1606
|
+
</div>
|
|
1607
|
+
|
|
1608
|
+
</li>
|
|
1609
|
+
|
|
1610
|
+
<li>
|
|
1611
|
+
|
|
1612
|
+
<span class='name'>row</span>
|
|
1613
|
+
|
|
1614
|
+
|
|
1615
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
|
|
1619
|
+
—
|
|
1620
|
+
<div class='inline'>
|
|
1621
|
+
<p>Data row being parsed.</p>
|
|
1622
|
+
</div>
|
|
1623
|
+
|
|
1624
|
+
</li>
|
|
1625
|
+
|
|
1626
|
+
</ul>
|
|
1627
|
+
|
|
1628
|
+
<p class="tag_title">Returns:</p>
|
|
1629
|
+
<ul class="return">
|
|
1630
|
+
|
|
1631
|
+
<li>
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
<span class='type'>(<tt>Array<(Array, <span class='object_link'><a href="ScanRow.html"
|
|
1635
|
+
title="CSVDecision2::ScanRow (class)">ScanRow</a></span>)></tt>)</span>
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
|
|
1639
|
+
—
|
|
1640
|
+
<div class='inline'>
|
|
1641
|
+
<p>Used to scan a table row against an input hash for matches.</p>
|
|
1642
|
+
</div>
|
|
1643
|
+
|
|
1644
|
+
</li>
|
|
1645
|
+
|
|
1646
|
+
</ul>
|
|
1647
|
+
|
|
1648
|
+
</div>
|
|
1649
|
+
<table class="source_code">
|
|
1650
|
+
<tr>
|
|
1651
|
+
<td>
|
|
1652
|
+
<pre class="lines">
|
|
1538
1653
|
|
|
1539
1654
|
|
|
1540
1655
|
187
|
|
1541
1656
|
188
|
|
1542
1657
|
189</pre>
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1658
|
+
</td>
|
|
1659
|
+
<td>
|
|
1660
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/matchers.rb', line 187</span>
|
|
1546
1661
|
|
|
1547
1662
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse_outs'>parse_outs</span><span class='lparen'>(</span><span class='label'>columns:</span><span class='comma'>,</span> <span class='label'>row:</span><span class='rparen'>)</span>
|
|
1548
|
-
<span class='const'><span class='object_link'><a href="" title="
|
|
1663
|
+
<span class='const'><span class='object_link'><a href="" title="CSVDecision2::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="#parse-class_method" title="CSVDecision2::Matchers.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='label'>columns:</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='label'>matchers:</span> <span class='ivar'>@outs</span><span class='comma'>,</span> <span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
|
|
1549
1664
|
<span class='kw'>end</span></pre>
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
</table>
|
|
1553
|
-
</div>
|
|
1554
|
-
|
|
1555
|
-
</div>
|
|
1665
|
+
</td>
|
|
1666
|
+
</tr>
|
|
1667
|
+
</table>
|
|
1668
|
+
</div>
|
|
1556
1669
|
|
|
1557
|
-
</div>
|
|
1670
|
+
</div>
|
|
1558
1671
|
|
|
1559
|
-
|
|
1560
|
-
Generated on Sun Feb 11 10:26:07 2018 by
|
|
1561
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1562
|
-
0.9.12 (ruby-2.4.0).
|
|
1563
|
-
</div>
|
|
1672
|
+
</div>
|
|
1564
1673
|
|
|
1674
|
+
<div id="footer">
|
|
1675
|
+
Generated on Sun Feb 11 10:26:07 2018 by
|
|
1676
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1677
|
+
0.9.12 (ruby-2.4.0).
|
|
1565
1678
|
</div>
|
|
1566
|
-
|
|
1567
|
-
</
|
|
1679
|
+
|
|
1680
|
+
</div>
|
|
1681
|
+
</body>
|
|
1682
|
+
|
|
1683
|
+
</html>
|