csv_decision2 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +3 -0
- data/.coveralls.yml +2 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.rubocop.yml +30 -0
- data/.travis.yml +6 -0
- data/CHANGELOG.md +85 -0
- data/Dockerfile +6 -0
- data/Gemfile +7 -0
- data/LICENSE +21 -0
- data/README.md +356 -0
- data/benchmarks/rufus_decision.rb +158 -0
- data/csv_decision2.gemspec +38 -0
- data/doc/CSVDecision/CellValidationError.html +143 -0
- data/doc/CSVDecision/Columns/Default.html +589 -0
- data/doc/CSVDecision/Columns/Dictionary.html +801 -0
- data/doc/CSVDecision/Columns/Entry.html +508 -0
- data/doc/CSVDecision/Columns.html +1259 -0
- data/doc/CSVDecision/Constant.html +254 -0
- data/doc/CSVDecision/Data.html +479 -0
- data/doc/CSVDecision/Decide.html +302 -0
- data/doc/CSVDecision/Decision.html +1011 -0
- data/doc/CSVDecision/Defaults.html +291 -0
- data/doc/CSVDecision/Dictionary/Entry.html +1147 -0
- data/doc/CSVDecision/Dictionary.html +426 -0
- data/doc/CSVDecision/Error.html +139 -0
- data/doc/CSVDecision/FileError.html +143 -0
- data/doc/CSVDecision/Function.html +240 -0
- data/doc/CSVDecision/Guard.html +245 -0
- data/doc/CSVDecision/Header.html +647 -0
- data/doc/CSVDecision/Index.html +741 -0
- data/doc/CSVDecision/Input.html +404 -0
- data/doc/CSVDecision/Load.html +296 -0
- data/doc/CSVDecision/Matchers/Constant.html +484 -0
- data/doc/CSVDecision/Matchers/Function.html +511 -0
- data/doc/CSVDecision/Matchers/Guard.html +503 -0
- data/doc/CSVDecision/Matchers/Matcher.html +507 -0
- data/doc/CSVDecision/Matchers/Numeric.html +415 -0
- data/doc/CSVDecision/Matchers/Pattern.html +491 -0
- data/doc/CSVDecision/Matchers/Proc.html +704 -0
- data/doc/CSVDecision/Matchers/Range.html +379 -0
- data/doc/CSVDecision/Matchers/Symbol.html +426 -0
- data/doc/CSVDecision/Matchers.html +1567 -0
- data/doc/CSVDecision/Numeric.html +259 -0
- data/doc/CSVDecision/Options.html +443 -0
- data/doc/CSVDecision/Parse.html +282 -0
- data/doc/CSVDecision/Paths.html +742 -0
- data/doc/CSVDecision/Result.html +1200 -0
- data/doc/CSVDecision/Scan/InputHashes.html +369 -0
- data/doc/CSVDecision/Scan.html +313 -0
- data/doc/CSVDecision/ScanRow.html +866 -0
- data/doc/CSVDecision/Symbol.html +256 -0
- data/doc/CSVDecision/Table.html +1470 -0
- data/doc/CSVDecision/TableValidationError.html +143 -0
- data/doc/CSVDecision/Validate.html +422 -0
- data/doc/CSVDecision.html +621 -0
- data/doc/_index.html +471 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +499 -0
- data/doc/file.README.html +421 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +421 -0
- data/doc/js/app.js +248 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1163 -0
- data/doc/top-level-namespace.html +110 -0
- data/docker-compose.yml +13 -0
- data/lib/csv_decision/columns.rb +192 -0
- data/lib/csv_decision/data.rb +92 -0
- data/lib/csv_decision/decision.rb +196 -0
- data/lib/csv_decision/defaults.rb +47 -0
- data/lib/csv_decision/dictionary.rb +180 -0
- data/lib/csv_decision/header.rb +83 -0
- data/lib/csv_decision/index.rb +107 -0
- data/lib/csv_decision/input.rb +121 -0
- data/lib/csv_decision/load.rb +36 -0
- data/lib/csv_decision/matchers/constant.rb +74 -0
- data/lib/csv_decision/matchers/function.rb +56 -0
- data/lib/csv_decision/matchers/guard.rb +142 -0
- data/lib/csv_decision/matchers/numeric.rb +44 -0
- data/lib/csv_decision/matchers/pattern.rb +94 -0
- data/lib/csv_decision/matchers/range.rb +95 -0
- data/lib/csv_decision/matchers/symbol.rb +149 -0
- data/lib/csv_decision/matchers.rb +220 -0
- data/lib/csv_decision/options.rb +124 -0
- data/lib/csv_decision/parse.rb +165 -0
- data/lib/csv_decision/paths.rb +78 -0
- data/lib/csv_decision/result.rb +204 -0
- data/lib/csv_decision/scan.rb +117 -0
- data/lib/csv_decision/scan_row.rb +142 -0
- data/lib/csv_decision/table.rb +101 -0
- data/lib/csv_decision/validate.rb +85 -0
- data/lib/csv_decision.rb +45 -0
- data/spec/csv_decision/columns_spec.rb +251 -0
- data/spec/csv_decision/constant_spec.rb +36 -0
- data/spec/csv_decision/data_spec.rb +50 -0
- data/spec/csv_decision/decision_spec.rb +19 -0
- data/spec/csv_decision/examples_spec.rb +242 -0
- data/spec/csv_decision/index_spec.rb +58 -0
- data/spec/csv_decision/input_spec.rb +55 -0
- data/spec/csv_decision/load_spec.rb +28 -0
- data/spec/csv_decision/matchers/function_spec.rb +82 -0
- data/spec/csv_decision/matchers/guard_spec.rb +170 -0
- data/spec/csv_decision/matchers/numeric_spec.rb +47 -0
- data/spec/csv_decision/matchers/pattern_spec.rb +183 -0
- data/spec/csv_decision/matchers/range_spec.rb +70 -0
- data/spec/csv_decision/matchers/symbol_spec.rb +67 -0
- data/spec/csv_decision/options_spec.rb +94 -0
- data/spec/csv_decision/parse_spec.rb +44 -0
- data/spec/csv_decision/table_spec.rb +683 -0
- data/spec/csv_decision_spec.rb +7 -0
- data/spec/data/invalid/empty.csv +0 -0
- data/spec/data/invalid/invalid_header1.csv +4 -0
- data/spec/data/invalid/invalid_header2.csv +4 -0
- data/spec/data/invalid/invalid_header3.csv +4 -0
- data/spec/data/invalid/invalid_header4.csv +4 -0
- data/spec/data/valid/benchmark_regexp.csv +10 -0
- data/spec/data/valid/index_example.csv +13 -0
- data/spec/data/valid/multi_column_index.csv +10 -0
- data/spec/data/valid/multi_column_index2.csv +12 -0
- data/spec/data/valid/options_in_file1.csv +5 -0
- data/spec/data/valid/options_in_file2.csv +5 -0
- data/spec/data/valid/options_in_file3.csv +13 -0
- data/spec/data/valid/regular_expressions.csv +11 -0
- data/spec/data/valid/simple_constants.csv +5 -0
- data/spec/data/valid/simple_example.csv +10 -0
- data/spec/data/valid/valid.csv +4 -0
- data/spec/spec_helper.rb +106 -0
- metadata +352 -0
@@ -0,0 +1,143 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Exception: CSVDecision::FileError
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.12
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "CSVDecision::FileError";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (F)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">FileError</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Exception: CSVDecision::FileError
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Error.html" title="CSVDecision::Error (class)">Error</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">StandardError</li>
|
78
|
+
|
79
|
+
<li class="next"><span class='object_link'><a href="Error.html" title="CSVDecision::Error (class)">Error</a></span></li>
|
80
|
+
|
81
|
+
<li class="next">CSVDecision::FileError</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<dl>
|
100
|
+
<dt>Defined in:</dt>
|
101
|
+
<dd>lib/csv_decision/parse.rb</dd>
|
102
|
+
</dl>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
|
109
|
+
<p>Table parsing error message enhanced to include the file being processed.</p>
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
<div class="tags">
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div id="footer">
|
136
|
+
Generated on Sun Feb 11 10:26:07 2018 by
|
137
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
138
|
+
0.9.12 (ruby-2.4.0).
|
139
|
+
</div>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</body>
|
143
|
+
</html>
|
@@ -0,0 +1,240 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: CSVDecision::Function
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.12
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "CSVDecision::Function";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (F)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Function</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: CSVDecision::Function
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/csv_decision/function.rb</dd>
|
82
|
+
</dl>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<h2>Overview</h2><div class="docstring">
|
87
|
+
<div class="discussion">
|
88
|
+
|
89
|
+
<p>Methods to recognise various function expressions. TODO: fully implement</p>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
<div class="tags">
|
95
|
+
|
96
|
+
|
97
|
+
</div>
|
98
|
+
<h2>Constant Summary</h2>
|
99
|
+
<dl class="constants">
|
100
|
+
|
101
|
+
<dt id="FUNCTION_RE-constant" class="">FUNCTION_RE =
|
102
|
+
<div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Function call regular expression.</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
</dt>
|
115
|
+
<dd><pre class="code"><span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_regexp'><span class='object_link'><a href="Matchers.html#regexp-class_method" title="CSVDecision::Matchers.regexp (method)">regexp</a></span></span><span class='lparen'>(</span><span class='const'>FUNCTION_CALL</span><span class='rparen'>)</span></pre></dd>
|
116
|
+
|
117
|
+
</dl>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
<h2>
|
127
|
+
Class Method Summary
|
128
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
129
|
+
</h2>
|
130
|
+
|
131
|
+
<ul class="summary">
|
132
|
+
|
133
|
+
<li class="public ">
|
134
|
+
<span class="summary_signature">
|
135
|
+
|
136
|
+
<a href="#matches%3F-class_method" title="matches? (class method)">.<strong>matches?</strong>(cell) ⇒ Boolean </a>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
</span>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
151
|
+
|
152
|
+
</li>
|
153
|
+
|
154
|
+
|
155
|
+
</ul>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<div id="class_method_details" class="method_details_list">
|
161
|
+
<h2>Class Method Details</h2>
|
162
|
+
|
163
|
+
|
164
|
+
<div class="method_details first">
|
165
|
+
<h3 class="signature first" id="matches?-class_method">
|
166
|
+
|
167
|
+
.<strong>matches?</strong>(cell) ⇒ <tt>Boolean</tt>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</h3><div class="docstring">
|
174
|
+
<div class="discussion">
|
175
|
+
|
176
|
+
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
<div class="tags">
|
180
|
+
|
181
|
+
<p class="tag_title">Returns:</p>
|
182
|
+
<ul class="return">
|
183
|
+
|
184
|
+
<li>
|
185
|
+
|
186
|
+
|
187
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
</li>
|
192
|
+
|
193
|
+
</ul>
|
194
|
+
|
195
|
+
</div><table class="source_code">
|
196
|
+
<tr>
|
197
|
+
<td>
|
198
|
+
<pre class="lines">
|
199
|
+
|
200
|
+
|
201
|
+
24
|
202
|
+
25
|
203
|
+
26
|
204
|
+
27
|
205
|
+
28
|
206
|
+
29
|
207
|
+
30
|
208
|
+
31
|
209
|
+
32</pre>
|
210
|
+
</td>
|
211
|
+
<td>
|
212
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/function.rb', line 24</span>
|
213
|
+
|
214
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_matches?'>matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span>
|
215
|
+
<span class='id identifier rubyid_match'>match</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#FUNCTION_RE-constant" title="CSVDecision::Function::FUNCTION_RE (constant)">FUNCTION_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_cell'>cell</span><span class='rparen'>)</span>
|
216
|
+
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_match'>match</span>
|
217
|
+
|
218
|
+
<span class='comment'># operator = match['operator']&.gsub(/\s+/, '')
|
219
|
+
</span> <span class='comment'># name = match['name'].to_sym
|
220
|
+
</span> <span class='comment'># args = match['args'].strip
|
221
|
+
</span> <span class='comment'># negate = match['negate'] == Matchers::NEGATE
|
222
|
+
</span><span class='kw'>end</span></pre>
|
223
|
+
</td>
|
224
|
+
</tr>
|
225
|
+
</table>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
</div>
|
229
|
+
|
230
|
+
</div>
|
231
|
+
|
232
|
+
<div id="footer">
|
233
|
+
Generated on Fri Dec 29 09:33:35 2017 by
|
234
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
235
|
+
0.9.12 (ruby-2.3.0).
|
236
|
+
</div>
|
237
|
+
|
238
|
+
</div>
|
239
|
+
</body>
|
240
|
+
</html>
|
@@ -0,0 +1,245 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: CSVDecision::Guard
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.12
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "CSVDecision::Guard";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (G)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Guard</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: CSVDecision::Guard
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/csv_decision/guard.rb</dd>
|
82
|
+
</dl>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<h2>Overview</h2><div class="docstring">
|
87
|
+
<div class="discussion">
|
88
|
+
|
89
|
+
<p>Recognise guard column symbol expressions in input column data cells -
|
90
|
+
e.g., <tt>> :column.present?</tt> or <tt>:column == 100.0</tt>.</p>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<div class="tags">
|
96
|
+
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<h2>
|
107
|
+
Class Method Summary
|
108
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
109
|
+
</h2>
|
110
|
+
|
111
|
+
<ul class="summary">
|
112
|
+
|
113
|
+
<li class="public ">
|
114
|
+
<span class="summary_signature">
|
115
|
+
|
116
|
+
<a href="#matches%3F-class_method" title="matches? (class method)">.<strong>matches?</strong>(cell) ⇒ false, CSVDecision::Proc </a>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
</span>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<span class="summary_desc"><div class='inline'>
|
131
|
+
<p>Determine if the input cell string is recognised by this Matcher.</p>
|
132
|
+
</div></span>
|
133
|
+
|
134
|
+
</li>
|
135
|
+
|
136
|
+
|
137
|
+
</ul>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<div id="class_method_details" class="method_details_list">
|
143
|
+
<h2>Class Method Details</h2>
|
144
|
+
|
145
|
+
|
146
|
+
<div class="method_details first">
|
147
|
+
<h3 class="signature first" id="matches?-class_method">
|
148
|
+
|
149
|
+
.<strong>matches?</strong>(cell) ⇒ <tt>false</tt>, <tt><span class='object_link'><a href="../CSVDecision.html#Proc-constant" title="CSVDecision::Proc (constant)">CSVDecision::Proc</a></span></tt>
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
</h3><div class="docstring">
|
156
|
+
<div class="discussion">
|
157
|
+
|
158
|
+
<p>Determine if the input cell string is recognised by this Matcher.</p>
|
159
|
+
|
160
|
+
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
<div class="tags">
|
164
|
+
<p class="tag_title">Parameters:</p>
|
165
|
+
<ul class="param">
|
166
|
+
|
167
|
+
<li>
|
168
|
+
|
169
|
+
<span class='name'>cell</span>
|
170
|
+
|
171
|
+
|
172
|
+
<span class='type'>(<tt>String</tt>)</span>
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
—
|
177
|
+
<div class='inline'>
|
178
|
+
<p>Data row cell.</p>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
</li>
|
182
|
+
|
183
|
+
</ul>
|
184
|
+
|
185
|
+
<p class="tag_title">Returns:</p>
|
186
|
+
<ul class="return">
|
187
|
+
|
188
|
+
<li>
|
189
|
+
|
190
|
+
|
191
|
+
<span class='type'>(<tt>false</tt>, <tt><span class='object_link'><a href="../CSVDecision.html#Proc-constant" title="CSVDecision::Proc (constant)">CSVDecision::Proc</a></span></tt>)</span>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
—
|
196
|
+
<div class='inline'>
|
197
|
+
<p>Returns false if this cell is not a match; otherwise returns the
|
198
|
+
<code>CSVDecision::Proc</code> object indicating if this is a constant or
|
199
|
+
some type of function.</p>
|
200
|
+
</div>
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
</ul>
|
205
|
+
|
206
|
+
</div><table class="source_code">
|
207
|
+
<tr>
|
208
|
+
<td>
|
209
|
+
<pre class="lines">
|
210
|
+
|
211
|
+
|
212
|
+
125
|
213
|
+
126
|
214
|
+
127
|
215
|
+
128
|
216
|
+
129
|
217
|
+
130</pre>
|
218
|
+
</td>
|
219
|
+
<td>
|
220
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/guard.rb', line 125</span>
|
221
|
+
|
222
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_matches?'>matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span>
|
223
|
+
<span class='id identifier rubyid_proc'>proc</span> <span class='op'>=</span> <span class='id identifier rubyid_symbol_proc'>symbol_proc</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span>
|
224
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_proc'>proc</span> <span class='kw'>if</span> <span class='id identifier rubyid_proc'>proc</span>
|
225
|
+
|
226
|
+
<span class='id identifier rubyid_symbol_guard'>symbol_guard</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span>
|
227
|
+
<span class='kw'>end</span></pre>
|
228
|
+
</td>
|
229
|
+
</tr>
|
230
|
+
</table>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
</div>
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<div id="footer">
|
238
|
+
Generated on Fri Dec 29 09:33:35 2017 by
|
239
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
240
|
+
0.9.12 (ruby-2.3.0).
|
241
|
+
</div>
|
242
|
+
|
243
|
+
</div>
|
244
|
+
</body>
|
245
|
+
</html>
|