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
data/doc/CSVDecision/Header.html
CHANGED
|
@@ -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
|
+
Module: CSVDecision2::Header
|
|
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::Header";
|
|
20
|
+
relpath = '../';
|
|
21
|
+
</script>
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
@@ -25,404 +26,432 @@
|
|
|
25
26
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
26
27
|
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
</head>
|
|
30
|
+
|
|
31
|
+
<body>
|
|
32
|
+
<div class="nav_wrap">
|
|
33
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
34
|
+
<div id="resizer"></div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div id="main" tabindex="-1">
|
|
38
|
+
<div id="header">
|
|
39
|
+
<div id="menu">
|
|
40
|
+
|
|
41
|
+
<a href="../_index.html">Index (H)</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">Header</span>
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div id="search">
|
|
50
|
+
|
|
51
|
+
<a class="full_list_link" id="class_list_link" href="../class_list.html">
|
|
52
|
+
|
|
53
|
+
<svg width="24" height="24">
|
|
54
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
56
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
57
|
+
</svg>
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
33
62
|
</div>
|
|
34
63
|
|
|
35
|
-
<div id="
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</div>
|
|
59
|
-
<div class="clear"></div>
|
|
64
|
+
<div id="content">
|
|
65
|
+
<h1>Module: CSVDecision2::Header
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
<span class="private note title">Private</span>
|
|
69
|
+
</h1>
|
|
70
|
+
<div class="box_info">
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
<dl>
|
|
83
|
+
<dt>Defined in:</dt>
|
|
84
|
+
<dd>lib/csv_decision2/header.rb</dd>
|
|
85
|
+
</dl>
|
|
86
|
+
|
|
60
87
|
</div>
|
|
61
88
|
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<dl>
|
|
80
|
-
<dt>Defined in:</dt>
|
|
81
|
-
<dd>lib/csv_decision/header.rb</dd>
|
|
82
|
-
</dl>
|
|
83
|
-
|
|
84
|
-
</div>
|
|
85
|
-
|
|
86
|
-
<h2>Overview</h2><div class="docstring">
|
|
87
|
-
<div class="discussion">
|
|
88
|
-
<p class="note private">
|
|
89
|
-
<strong>This module is part of a private API.</strong>
|
|
90
|
-
You should avoid using this module if possible, as it may be removed or be changed in the future.
|
|
91
|
-
</p>
|
|
92
|
-
|
|
93
|
-
<p>Parse the CSV file's header row. These methods are only required at
|
|
94
|
-
table load time.</p>
|
|
89
|
+
<h2>Overview</h2>
|
|
90
|
+
<div class="docstring">
|
|
91
|
+
<div class="discussion">
|
|
92
|
+
<p class="note private">
|
|
93
|
+
<strong>This module is part of a private API.</strong>
|
|
94
|
+
You should avoid using this module if possible, as it may be removed or be changed in the future.
|
|
95
|
+
</p>
|
|
95
96
|
|
|
97
|
+
<p>Parse the CSV file's header row. These methods are only required at
|
|
98
|
+
table load time.</p>
|
|
96
99
|
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
<div class="tags">
|
|
100
|
-
|
|
101
100
|
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<dt id="COLUMN_TYPE-constant" class="">COLUMN_TYPE =
|
|
107
|
-
<div class="docstring">
|
|
108
|
-
<div class="discussion">
|
|
109
|
-
<p class="note private">
|
|
110
|
-
<strong>This constant is part of a private API.</strong>
|
|
111
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
112
|
-
</p>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="tags">
|
|
113
104
|
|
|
114
|
-
<p>Column types recognised in the header row.</p>
|
|
115
105
|
|
|
106
|
+
</div>
|
|
107
|
+
<h2>Constant Summary</h2>
|
|
108
|
+
<dl class="constants">
|
|
116
109
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<div class="
|
|
120
|
-
|
|
110
|
+
<dt id="COLUMN_TYPE-constant" class="">COLUMN_TYPE =
|
|
111
|
+
<div class="docstring">
|
|
112
|
+
<div class="discussion">
|
|
113
|
+
<p class="note private">
|
|
114
|
+
<strong>This constant is part of a private API.</strong>
|
|
115
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
116
|
+
</p>
|
|
117
|
+
|
|
118
|
+
<p>Column types recognised in the header row.</p>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="tags">
|
|
121
124
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
|
|
126
|
+
</div>
|
|
127
|
+
</dt>
|
|
128
|
+
<dd>
|
|
129
|
+
<pre class="code"><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>
|
|
125
130
|
\A(?<type>in/text|in|out/text|out|guard|if|set/nil\?|set/blank\?|set|path)
|
|
126
131
|
\s*:\s*(?<name>\S?.*)\z
|
|
127
|
-
</span><span class='regexp_end'>}xi</span></span></pre
|
|
128
|
-
|
|
129
|
-
<dt id="COLUMN_NAME-constant" class="">COLUMN_NAME =
|
|
130
|
-
<div class="docstring">
|
|
131
|
-
<div class="discussion">
|
|
132
|
-
<p class="note private">
|
|
133
|
-
<strong>This constant is part of a private API.</strong>
|
|
134
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
135
|
-
</p>
|
|
132
|
+
</span><span class='regexp_end'>}xi</span></span></pre>
|
|
133
|
+
</dd>
|
|
136
134
|
|
|
137
|
-
<
|
|
138
|
-
|
|
135
|
+
<dt id="COLUMN_NAME-constant" class="">COLUMN_NAME =
|
|
136
|
+
<div class="docstring">
|
|
137
|
+
<div class="discussion">
|
|
138
|
+
<p class="note private">
|
|
139
|
+
<strong>This constant is part of a private API.</strong>
|
|
140
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
141
|
+
</p>
|
|
139
142
|
|
|
143
|
+
<p>Regular expression string for a column name. More lenient than a Ruby
|
|
144
|
+
method name - note any spaces will have been replaced with underscores.</p>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
<div class="tags">
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
</div>
|
|
153
|
+
</dt>
|
|
154
|
+
<dd>
|
|
155
|
+
<pre
|
|
156
|
+
class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\w[\\w:/!?]*</span><span class='tstring_end'>"</span></span></pre>
|
|
157
|
+
</dd>
|
|
158
|
+
|
|
159
|
+
</dl>
|
|
140
160
|
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
<div class="tags">
|
|
144
|
-
|
|
145
161
|
|
|
146
|
-
</div>
|
|
147
|
-
</dt>
|
|
148
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\w[\\w:/!?]*</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
149
|
-
|
|
150
|
-
</dl>
|
|
151
162
|
|
|
152
163
|
|
|
153
164
|
|
|
154
165
|
|
|
155
166
|
|
|
156
167
|
|
|
168
|
+
<h2>
|
|
169
|
+
Class Method Summary
|
|
170
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
171
|
+
</h2>
|
|
157
172
|
|
|
158
|
-
|
|
159
|
-
<h2>
|
|
160
|
-
Class Method Summary
|
|
161
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
162
|
-
</h2>
|
|
173
|
+
<ul class="summary">
|
|
163
174
|
|
|
164
|
-
<ul class="summary">
|
|
165
|
-
|
|
166
175
|
<li class="public ">
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
</
|
|
188
|
-
|
|
189
|
-
|
|
176
|
+
<span class="summary_signature">
|
|
177
|
+
|
|
178
|
+
<a href="#column_name%3F-class_method"
|
|
179
|
+
title="column_name? (class method)">.<strong>column_name?</strong>(column_name) ⇒ Boolean </a>
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
</span>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
<span class="private note title">private</span>
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
<span class="summary_desc">
|
|
194
|
+
<div class='inline'>
|
|
195
|
+
<p>Return true if column name is valid.</p>
|
|
196
|
+
</div>
|
|
197
|
+
</span>
|
|
198
|
+
|
|
199
|
+
</li>
|
|
200
|
+
|
|
201
|
+
|
|
190
202
|
<li class="public ">
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
</
|
|
212
|
-
|
|
213
|
-
|
|
203
|
+
<span class="summary_signature">
|
|
204
|
+
|
|
205
|
+
<a href="#parse-class_method" title="parse (class method)">.<strong>parse</strong>(table:, matchers:)
|
|
206
|
+
⇒ CSVDecision2::Columns </a>
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
</span>
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
<span class="private note title">private</span>
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
<span class="summary_desc">
|
|
221
|
+
<div class='inline'>
|
|
222
|
+
<p>Parse the header row, and the defaults row if present.</p>
|
|
223
|
+
</div>
|
|
224
|
+
</span>
|
|
225
|
+
|
|
226
|
+
</li>
|
|
227
|
+
|
|
228
|
+
|
|
214
229
|
<li class="public ">
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
<
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
</
|
|
236
|
-
|
|
237
|
-
|
|
230
|
+
<span class="summary_signature">
|
|
231
|
+
|
|
232
|
+
<a href="#row%3F-class_method" title="row? (class method)">.<strong>row?</strong>(row) ⇒ Boolean </a>
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
</span>
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
<span class="private note title">private</span>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
<span class="summary_desc">
|
|
247
|
+
<div class='inline'>
|
|
248
|
+
<p>Check if the given row contains a recognisable header cell.</p>
|
|
249
|
+
</div>
|
|
250
|
+
</span>
|
|
251
|
+
|
|
252
|
+
</li>
|
|
253
|
+
|
|
254
|
+
|
|
238
255
|
<li class="public ">
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
<a href="#strip_empty_columns-class_method" title="strip_empty_columns (class method)">.<strong>strip_empty_columns</strong>(rows:) ⇒ Array<Array<String>> </a>
|
|
242
|
-
|
|
256
|
+
<span class="summary_signature">
|
|
243
257
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
<span class="private note title">private</span>
|
|
258
|
+
<a href="#strip_empty_columns-class_method"
|
|
259
|
+
title="strip_empty_columns (class method)">.<strong>strip_empty_columns</strong>(rows:) ⇒
|
|
260
|
+
Array<Array<String>> </a>
|
|
253
261
|
|
|
254
|
-
|
|
255
|
-
<span class="summary_desc"><div class='inline'>
|
|
256
|
-
<p>Strip empty columns from all data rows.</p>
|
|
257
|
-
</div></span>
|
|
258
|
-
|
|
259
|
-
</li>
|
|
260
262
|
|
|
261
|
-
|
|
262
|
-
</ul>
|
|
263
|
-
|
|
264
263
|
|
|
264
|
+
</span>
|
|
265
265
|
|
|
266
266
|
|
|
267
|
-
<div id="class_method_details" class="method_details_list">
|
|
268
|
-
<h2>Class Method Details</h2>
|
|
269
267
|
|
|
270
|
-
|
|
271
|
-
<div class="method_details first">
|
|
272
|
-
<h3 class="signature first" id="column_name?-class_method">
|
|
273
|
-
|
|
274
|
-
.<strong>column_name?</strong>(column_name) ⇒ <tt>Boolean</tt>
|
|
275
|
-
|
|
276
268
|
|
|
277
|
-
|
|
278
269
|
|
|
279
|
-
|
|
280
|
-
</h3><div class="docstring">
|
|
281
|
-
<div class="discussion">
|
|
282
|
-
<p class="note private">
|
|
283
|
-
<strong>This method is part of a private API.</strong>
|
|
284
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
285
|
-
</p>
|
|
286
270
|
|
|
287
|
-
<
|
|
271
|
+
<span class="private note title">private</span>
|
|
288
272
|
|
|
289
273
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
<
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
<
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
</
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
274
|
+
<span class="summary_desc">
|
|
275
|
+
<div class='inline'>
|
|
276
|
+
<p>Strip empty columns from all data rows.</p>
|
|
277
|
+
</div>
|
|
278
|
+
</span>
|
|
279
|
+
|
|
280
|
+
</li>
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
</ul>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
<div id="class_method_details" class="method_details_list">
|
|
289
|
+
<h2>Class Method Details</h2>
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
<div class="method_details first">
|
|
293
|
+
<h3 class="signature first" id="column_name?-class_method">
|
|
294
|
+
|
|
295
|
+
.<strong>column_name?</strong>(column_name) ⇒ <tt>Boolean</tt>
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
</h3>
|
|
302
|
+
<div class="docstring">
|
|
303
|
+
<div class="discussion">
|
|
304
|
+
<p class="note private">
|
|
305
|
+
<strong>This method is part of a private API.</strong>
|
|
306
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
307
|
+
</p>
|
|
308
|
+
|
|
309
|
+
<p>Return true if column name is valid.</p>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
<div class="tags">
|
|
315
|
+
<p class="tag_title">Parameters:</p>
|
|
316
|
+
<ul class="param">
|
|
317
|
+
|
|
318
|
+
<li>
|
|
319
|
+
|
|
320
|
+
<span class='name'>column_name</span>
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
</li>
|
|
328
|
+
|
|
329
|
+
</ul>
|
|
330
|
+
|
|
331
|
+
<p class="tag_title">Returns:</p>
|
|
332
|
+
<ul class="return">
|
|
333
|
+
|
|
334
|
+
<li>
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
</li>
|
|
342
|
+
|
|
343
|
+
</ul>
|
|
344
|
+
|
|
345
|
+
</div>
|
|
346
|
+
<table class="source_code">
|
|
347
|
+
<tr>
|
|
348
|
+
<td>
|
|
349
|
+
<pre class="lines">
|
|
327
350
|
|
|
328
351
|
|
|
329
352
|
30
|
|
330
353
|
31
|
|
331
354
|
32</pre>
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
355
|
+
</td>
|
|
356
|
+
<td>
|
|
357
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/header.rb', line 30</span>
|
|
335
358
|
|
|
336
359
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_column_name?'>column_name?</span><span class='lparen'>(</span><span class='id identifier rubyid_column_name'>column_name</span><span class='rparen'>)</span>
|
|
337
360
|
<span class='const'>COLUMN_NAME_RE</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_column_name'>column_name</span><span class='rparen'>)</span>
|
|
338
361
|
<span class='kw'>end</span></pre>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
</table>
|
|
342
|
-
</div>
|
|
343
|
-
|
|
344
|
-
<div class="method_details ">
|
|
345
|
-
<h3 class="signature " id="parse-class_method">
|
|
346
|
-
|
|
347
|
-
.<strong>parse</strong>(table:, matchers:) ⇒ <tt><span class='object_link'><a href="Columns.html" title="CSVDecision::Columns (class)">CSVDecision::Columns</a></span></tt>
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
</h3><div class="docstring">
|
|
354
|
-
<div class="discussion">
|
|
355
|
-
<p class="note private">
|
|
356
|
-
<strong>This method is part of a private API.</strong>
|
|
357
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
358
|
-
</p>
|
|
359
|
-
|
|
360
|
-
<p>Parse the header row, and the defaults row if present.</p>
|
|
362
|
+
</td>
|
|
363
|
+
</tr>
|
|
364
|
+
</table>
|
|
365
|
+
</div>
|
|
361
366
|
|
|
367
|
+
<div class="method_details ">
|
|
368
|
+
<h3 class="signature " id="parse-class_method">
|
|
362
369
|
|
|
363
|
-
|
|
364
|
-
</
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
</div>
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
<
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
<
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
370
|
+
.<strong>parse</strong>(table:, matchers:) ⇒ <tt><span class='object_link'><a href="Columns.html"
|
|
371
|
+
title="CSVDecision2::Columns (class)">CSVDecision2::Columns</a></span></tt>
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
</h3>
|
|
378
|
+
<div class="docstring">
|
|
379
|
+
<div class="discussion">
|
|
380
|
+
<p class="note private">
|
|
381
|
+
<strong>This method is part of a private API.</strong>
|
|
382
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
383
|
+
</p>
|
|
384
|
+
|
|
385
|
+
<p>Parse the header row, and the defaults row if present.</p>
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
</div>
|
|
389
|
+
</div>
|
|
390
|
+
<div class="tags">
|
|
391
|
+
<p class="tag_title">Parameters:</p>
|
|
392
|
+
<ul class="param">
|
|
393
|
+
|
|
394
|
+
<li>
|
|
395
|
+
|
|
396
|
+
<span class='name'>table</span>
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
<span class='type'>(<tt><span class='object_link'><a href="Table.html"
|
|
400
|
+
title="CSVDecision2::Table (class)">CSVDecision2::Table</a></span></tt>)</span>
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
—
|
|
405
|
+
<div class='inline'>
|
|
406
|
+
<p>Decision table being parsed.</p>
|
|
407
|
+
</div>
|
|
408
|
+
|
|
409
|
+
</li>
|
|
410
|
+
|
|
411
|
+
<li>
|
|
412
|
+
|
|
413
|
+
<span class='name'>matchers</span>
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
<span class='type'>(<tt>Array<<span class='object_link'><a href="Matchers/Matcher.html"
|
|
417
|
+
title="CSVDecision2::Matchers::Matcher (class)">Matchers::Matcher</a></span>></tt>)</span>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
—
|
|
422
|
+
<div class='inline'>
|
|
423
|
+
<p>Array of special cell matchers.</p>
|
|
424
|
+
</div>
|
|
425
|
+
|
|
426
|
+
</li>
|
|
427
|
+
|
|
428
|
+
</ul>
|
|
429
|
+
|
|
430
|
+
<p class="tag_title">Returns:</p>
|
|
431
|
+
<ul class="return">
|
|
432
|
+
|
|
433
|
+
<li>
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
<span class='type'>(<tt><span class='object_link'><a href="Columns.html"
|
|
437
|
+
title="CSVDecision2::Columns (class)">CSVDecision2::Columns</a></span></tt>)</span>
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
—
|
|
442
|
+
<div class='inline'>
|
|
443
|
+
<p>Table columns object.</p>
|
|
444
|
+
</div>
|
|
445
|
+
|
|
446
|
+
</li>
|
|
447
|
+
|
|
448
|
+
</ul>
|
|
449
|
+
|
|
450
|
+
</div>
|
|
451
|
+
<table class="source_code">
|
|
452
|
+
<tr>
|
|
453
|
+
<td>
|
|
454
|
+
<pre class="lines">
|
|
426
455
|
|
|
427
456
|
|
|
428
457
|
59
|
|
@@ -437,176 +466,180 @@ method name - note any spaces will have been replaced with underscores.</p>
|
|
|
437
466
|
68
|
|
438
467
|
69
|
|
439
468
|
70</pre>
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
469
|
+
</td>
|
|
470
|
+
<td>
|
|
471
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/header.rb', line 59</span>
|
|
443
472
|
|
|
444
473
|
<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'>table:</span><span class='comma'>,</span> <span class='label'>matchers:</span><span class='rparen'>)</span>
|
|
445
474
|
<span class='comment'># Parse the header row
|
|
446
|
-
</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../
|
|
475
|
+
</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../CSVDecision2.html" title="CSVDecision (module)">CSVDecision</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Columns.html" title="CSVDecision2::Columns (class)">Columns</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Columns.html#initialize-instance_method" title="CSVDecision2::Columns#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='rparen'>)</span>
|
|
447
476
|
|
|
448
477
|
<span class='comment'># Parse the defaults row if present
|
|
449
478
|
</span> <span class='kw'>return</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span> <span class='kw'>if</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_defaults'>defaults</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
|
|
450
479
|
|
|
451
480
|
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_defaults'>defaults</span> <span class='op'>=</span>
|
|
452
|
-
<span class='const'><span class='object_link'><a href="Defaults.html" title="
|
|
481
|
+
<span class='const'><span class='object_link'><a href="Defaults.html" title="CSVDecision2::Defaults (module)">Defaults</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="Defaults.html#parse-class_method" title="CSVDecision2::Defaults.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='label'>columns:</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='label'>matchers:</span> <span class='id identifier rubyid_matchers'>matchers</span><span class='period'>.</span><span class='id identifier rubyid_outs'>outs</span><span class='comma'>,</span> <span class='label'>row:</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_rows'>rows</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span><span class='rparen'>)</span>
|
|
453
482
|
|
|
454
483
|
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span>
|
|
455
484
|
<span class='kw'>end</span></pre>
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
</table>
|
|
459
|
-
</div>
|
|
460
|
-
|
|
461
|
-
<div class="method_details ">
|
|
462
|
-
<h3 class="signature " id="row?-class_method">
|
|
463
|
-
|
|
464
|
-
.<strong>row?</strong>(row) ⇒ <tt>Boolean</tt>
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
</h3><div class="docstring">
|
|
471
|
-
<div class="discussion">
|
|
472
|
-
<p class="note private">
|
|
473
|
-
<strong>This method is part of a private API.</strong>
|
|
474
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
475
|
-
</p>
|
|
476
|
-
|
|
477
|
-
<p>Check if the given row contains a recognisable header cell.</p>
|
|
485
|
+
</td>
|
|
486
|
+
</tr>
|
|
487
|
+
</table>
|
|
488
|
+
</div>
|
|
478
489
|
|
|
490
|
+
<div class="method_details ">
|
|
491
|
+
<h3 class="signature " id="row?-class_method">
|
|
479
492
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
</div>
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
<
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
</
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
493
|
+
.<strong>row?</strong>(row) ⇒ <tt>Boolean</tt>
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
</h3>
|
|
500
|
+
<div class="docstring">
|
|
501
|
+
<div class="discussion">
|
|
502
|
+
<p class="note private">
|
|
503
|
+
<strong>This method is part of a private API.</strong>
|
|
504
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
505
|
+
</p>
|
|
506
|
+
|
|
507
|
+
<p>Check if the given row contains a recognisable header cell.</p>
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
</div>
|
|
511
|
+
</div>
|
|
512
|
+
<div class="tags">
|
|
513
|
+
<p class="tag_title">Parameters:</p>
|
|
514
|
+
<ul class="param">
|
|
515
|
+
|
|
516
|
+
<li>
|
|
517
|
+
|
|
518
|
+
<span class='name'>row</span>
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
—
|
|
526
|
+
<div class='inline'>
|
|
527
|
+
<p>Header row.</p>
|
|
528
|
+
</div>
|
|
529
|
+
|
|
530
|
+
</li>
|
|
531
|
+
|
|
532
|
+
</ul>
|
|
533
|
+
|
|
534
|
+
<p class="tag_title">Returns:</p>
|
|
535
|
+
<ul class="return">
|
|
536
|
+
|
|
537
|
+
<li>
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
—
|
|
545
|
+
<div class='inline'>
|
|
546
|
+
<p>Return true if the row looks like a header.</p>
|
|
547
|
+
</div>
|
|
548
|
+
|
|
549
|
+
</li>
|
|
550
|
+
|
|
551
|
+
</ul>
|
|
552
|
+
|
|
553
|
+
</div>
|
|
554
|
+
<table class="source_code">
|
|
555
|
+
<tr>
|
|
556
|
+
<td>
|
|
557
|
+
<pre class="lines">
|
|
527
558
|
|
|
528
559
|
|
|
529
560
|
38
|
|
530
561
|
39
|
|
531
562
|
40</pre>
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
563
|
+
</td>
|
|
564
|
+
<td>
|
|
565
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/header.rb', line 38</span>
|
|
535
566
|
|
|
536
567
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_row?'>row?</span><span class='lparen'>(</span><span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
|
|
537
|
-
<span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cell'>cell</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="#COLUMN_TYPE-constant" title="
|
|
568
|
+
<span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cell'>cell</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="#COLUMN_TYPE-constant" title="CSVDecision2::Header::COLUMN_TYPE (constant)">COLUMN_TYPE</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> <span class='rbrace'>}</span>
|
|
538
569
|
<span class='kw'>end</span></pre>
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
</table>
|
|
542
|
-
</div>
|
|
543
|
-
|
|
544
|
-
<div class="method_details ">
|
|
545
|
-
<h3 class="signature " id="strip_empty_columns-class_method">
|
|
546
|
-
|
|
547
|
-
.<strong>strip_empty_columns</strong>(rows:) ⇒ <tt>Array<Array<String>></tt>
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
</h3><div class="docstring">
|
|
554
|
-
<div class="discussion">
|
|
555
|
-
<p class="note private">
|
|
556
|
-
<strong>This method is part of a private API.</strong>
|
|
557
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
558
|
-
</p>
|
|
559
|
-
|
|
560
|
-
<p>Strip empty columns from all data rows.</p>
|
|
570
|
+
</td>
|
|
571
|
+
</tr>
|
|
572
|
+
</table>
|
|
573
|
+
</div>
|
|
561
574
|
|
|
575
|
+
<div class="method_details ">
|
|
576
|
+
<h3 class="signature " id="strip_empty_columns-class_method">
|
|
562
577
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
</div>
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
<
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
</
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
578
|
+
.<strong>strip_empty_columns</strong>(rows:) ⇒ <tt>Array<Array<String>></tt>
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
</h3>
|
|
585
|
+
<div class="docstring">
|
|
586
|
+
<div class="discussion">
|
|
587
|
+
<p class="note private">
|
|
588
|
+
<strong>This method is part of a private API.</strong>
|
|
589
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
590
|
+
</p>
|
|
591
|
+
|
|
592
|
+
<p>Strip empty columns from all data rows.</p>
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
</div>
|
|
596
|
+
</div>
|
|
597
|
+
<div class="tags">
|
|
598
|
+
<p class="tag_title">Parameters:</p>
|
|
599
|
+
<ul class="param">
|
|
600
|
+
|
|
601
|
+
<li>
|
|
602
|
+
|
|
603
|
+
<span class='name'>rows</span>
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
<span class='type'>(<tt>Array<Array<String>></tt>)</span>
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
—
|
|
611
|
+
<div class='inline'>
|
|
612
|
+
<p>Data rows.</p>
|
|
613
|
+
</div>
|
|
614
|
+
|
|
615
|
+
</li>
|
|
616
|
+
|
|
617
|
+
</ul>
|
|
618
|
+
|
|
619
|
+
<p class="tag_title">Returns:</p>
|
|
620
|
+
<ul class="return">
|
|
621
|
+
|
|
622
|
+
<li>
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
<span class='type'>(<tt>Array<Array<String>></tt>)</span>
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
—
|
|
630
|
+
<div class='inline'>
|
|
631
|
+
<p>Data array after removing any empty columns and the header row.</p>
|
|
632
|
+
</div>
|
|
633
|
+
|
|
634
|
+
</li>
|
|
635
|
+
|
|
636
|
+
</ul>
|
|
637
|
+
|
|
638
|
+
</div>
|
|
639
|
+
<table class="source_code">
|
|
640
|
+
<tr>
|
|
641
|
+
<td>
|
|
642
|
+
<pre class="lines">
|
|
610
643
|
|
|
611
644
|
|
|
612
645
|
47
|
|
@@ -616,32 +649,33 @@ method name - note any spaces will have been replaced with underscores.</p>
|
|
|
616
649
|
51
|
|
617
650
|
52
|
|
618
651
|
53</pre>
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
652
|
+
</td>
|
|
653
|
+
<td>
|
|
654
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/header.rb', line 47</span>
|
|
622
655
|
|
|
623
656
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_strip_empty_columns'>strip_empty_columns</span><span class='lparen'>(</span><span class='label'>rows:</span><span class='rparen'>)</span>
|
|
624
657
|
<span class='id identifier rubyid_empty_cols'>empty_cols</span> <span class='op'>=</span> <span class='id identifier rubyid_empty_columns?'>empty_columns?</span><span class='lparen'>(</span><span class='label'>row:</span> <span class='id identifier rubyid_rows'>rows</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rparen'>)</span>
|
|
625
|
-
<span class='const'><span class='object_link'><a href="Data.html" title="
|
|
658
|
+
<span class='const'><span class='object_link'><a href="Data.html" title="CSVDecision2::Data (module)">Data</a></span></span><span class='period'>.</span><span class='id identifier rubyid_strip_columns'><span class='object_link'><a href="Data.html#strip_columns-class_method" title="CSVDecision2::Data.strip_columns (method)">strip_columns</a></span></span><span class='lparen'>(</span><span class='label'>data:</span> <span class='id identifier rubyid_rows'>rows</span><span class='comma'>,</span> <span class='label'>empty_columns:</span> <span class='id identifier rubyid_empty_cols'>empty_cols</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_empty_cols'>empty_cols</span>
|
|
626
659
|
|
|
627
660
|
<span class='comment'># Remove header row from the data array.
|
|
628
661
|
</span> <span class='id identifier rubyid_rows'>rows</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span>
|
|
629
662
|
<span class='kw'>end</span></pre>
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
</table>
|
|
633
|
-
</div>
|
|
634
|
-
|
|
635
|
-
</div>
|
|
663
|
+
</td>
|
|
664
|
+
</tr>
|
|
665
|
+
</table>
|
|
666
|
+
</div>
|
|
636
667
|
|
|
637
|
-
</div>
|
|
668
|
+
</div>
|
|
638
669
|
|
|
639
|
-
|
|
640
|
-
Generated on Sun Feb 11 10:26:07 2018 by
|
|
641
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
642
|
-
0.9.12 (ruby-2.4.0).
|
|
643
|
-
</div>
|
|
670
|
+
</div>
|
|
644
671
|
|
|
672
|
+
<div id="footer">
|
|
673
|
+
Generated on Sun Feb 11 10:26:07 2018 by
|
|
674
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
675
|
+
0.9.12 (ruby-2.4.0).
|
|
645
676
|
</div>
|
|
646
|
-
|
|
647
|
-
</
|
|
677
|
+
|
|
678
|
+
</div>
|
|
679
|
+
</body>
|
|
680
|
+
|
|
681
|
+
</html>
|