csv_decision2 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +1 -1
  3. data/README.md +16 -16
  4. data/benchmarks/rufus_decision.rb +5 -7
  5. data/csv_decision2.gemspec +2 -2
  6. data/doc/CSVDecision/CellValidationError.html +117 -110
  7. data/doc/CSVDecision/Columns/Default.html +537 -508
  8. data/doc/CSVDecision/Columns/Dictionary.html +729 -686
  9. data/doc/CSVDecision/Columns/Entry.html +457 -433
  10. data/doc/CSVDecision/Columns.html +1134 -1051
  11. data/doc/CSVDecision/Constant.html +205 -191
  12. data/doc/CSVDecision/Data.html +423 -398
  13. data/doc/CSVDecision/Decide.html +236 -225
  14. data/doc/CSVDecision/Decision.html +872 -825
  15. data/doc/CSVDecision/Defaults.html +243 -230
  16. data/doc/CSVDecision/Dictionary/Entry.html +1026 -964
  17. data/doc/CSVDecision/Dictionary.html +377 -355
  18. data/doc/CSVDecision/Error.html +116 -105
  19. data/doc/CSVDecision/FileError.html +117 -110
  20. data/doc/CSVDecision/Function.html +181 -168
  21. data/doc/CSVDecision/Guard.html +200 -185
  22. data/doc/CSVDecision/Header.html +557 -523
  23. data/doc/CSVDecision/Index.html +652 -617
  24. data/doc/CSVDecision/Input.html +329 -312
  25. data/doc/CSVDecision/Load.html +232 -220
  26. data/doc/CSVDecision/Matchers/Constant.html +432 -399
  27. data/doc/CSVDecision/Matchers/Function.html +451 -415
  28. data/doc/CSVDecision/Matchers/Guard.html +459 -424
  29. data/doc/CSVDecision/Matchers/Matcher.html +470 -426
  30. data/doc/CSVDecision/Matchers/Numeric.html +375 -346
  31. data/doc/CSVDecision/Matchers/Pattern.html +429 -396
  32. data/doc/CSVDecision/Matchers/Proc.html +617 -575
  33. data/doc/CSVDecision/Matchers/Range.html +331 -302
  34. data/doc/CSVDecision/Matchers/Symbol.html +386 -353
  35. data/doc/CSVDecision/Matchers.html +1509 -1393
  36. data/doc/CSVDecision/Numeric.html +201 -188
  37. data/doc/CSVDecision/Options.html +376 -357
  38. data/doc/CSVDecision/Parse.html +217 -204
  39. data/doc/CSVDecision/Paths.html +664 -629
  40. data/doc/CSVDecision/Result.html +1076 -1005
  41. data/doc/CSVDecision/Scan/InputHashes.html +305 -288
  42. data/doc/CSVDecision/Scan.html +262 -249
  43. data/doc/CSVDecision/ScanRow.html +749 -705
  44. data/doc/CSVDecision/Symbol.html +204 -191
  45. data/doc/CSVDecision/Table.html +1391 -1305
  46. data/doc/CSVDecision/TableValidationError.html +117 -110
  47. data/doc/CSVDecision/Validate.html +353 -337
  48. data/doc/CSVDecision.html +623 -552
  49. data/doc/_index.html +488 -448
  50. data/doc/class_list.html +250 -45
  51. data/doc/file.README.html +304 -278
  52. data/doc/index.html +304 -278
  53. data/doc/method_list.html +1159 -1017
  54. data/doc/top-level-namespace.html +79 -75
  55. data/lib/{csv_decision → csv_decision2}/columns.rb +7 -7
  56. data/lib/{csv_decision → csv_decision2}/data.rb +1 -1
  57. data/lib/{csv_decision → csv_decision2}/decision.rb +5 -5
  58. data/lib/{csv_decision → csv_decision2}/defaults.rb +2 -2
  59. data/lib/{csv_decision → csv_decision2}/dictionary.rb +2 -2
  60. data/lib/{csv_decision → csv_decision2}/header.rb +5 -5
  61. data/lib/{csv_decision → csv_decision2}/index.rb +5 -5
  62. data/lib/{csv_decision → csv_decision2}/input.rb +3 -3
  63. data/lib/{csv_decision → csv_decision2}/load.rb +6 -6
  64. data/lib/{csv_decision → csv_decision2}/matchers/constant.rb +2 -2
  65. data/lib/{csv_decision → csv_decision2}/matchers/function.rb +2 -2
  66. data/lib/{csv_decision → csv_decision2}/matchers/guard.rb +2 -2
  67. data/lib/{csv_decision → csv_decision2}/matchers/numeric.rb +2 -2
  68. data/lib/{csv_decision → csv_decision2}/matchers/pattern.rb +2 -2
  69. data/lib/{csv_decision → csv_decision2}/matchers/range.rb +2 -2
  70. data/lib/{csv_decision → csv_decision2}/matchers/symbol.rb +2 -2
  71. data/lib/{csv_decision → csv_decision2}/matchers.rb +5 -5
  72. data/lib/{csv_decision → csv_decision2}/options.rb +3 -3
  73. data/lib/{csv_decision → csv_decision2}/parse.rb +14 -14
  74. data/lib/{csv_decision → csv_decision2}/paths.rb +5 -5
  75. data/lib/{csv_decision → csv_decision2}/result.rb +2 -2
  76. data/lib/{csv_decision → csv_decision2}/scan.rb +3 -3
  77. data/lib/{csv_decision → csv_decision2}/scan_row.rb +2 -2
  78. data/lib/{csv_decision → csv_decision2}/table.rb +8 -8
  79. data/lib/{csv_decision → csv_decision2}/validate.rb +2 -2
  80. data/lib/csv_decision2.rb +45 -0
  81. data/spec/{csv_decision → csv_decision2}/columns_spec.rb +44 -44
  82. data/spec/{csv_decision → csv_decision2}/constant_spec.rb +4 -4
  83. data/spec/{csv_decision → csv_decision2}/data_spec.rb +11 -11
  84. data/spec/{csv_decision → csv_decision2}/decision_spec.rb +6 -6
  85. data/spec/{csv_decision → csv_decision2}/examples_spec.rb +14 -14
  86. data/spec/{csv_decision → csv_decision2}/index_spec.rb +8 -8
  87. data/spec/{csv_decision → csv_decision2}/input_spec.rb +9 -9
  88. data/spec/{csv_decision → csv_decision2}/load_spec.rb +8 -8
  89. data/spec/{csv_decision → csv_decision2}/matchers/function_spec.rb +7 -7
  90. data/spec/{csv_decision → csv_decision2}/matchers/guard_spec.rb +14 -14
  91. data/spec/{csv_decision → csv_decision2}/matchers/numeric_spec.rb +5 -5
  92. data/spec/{csv_decision → csv_decision2}/matchers/pattern_spec.rb +6 -6
  93. data/spec/{csv_decision → csv_decision2}/matchers/range_spec.rb +5 -5
  94. data/spec/{csv_decision → csv_decision2}/matchers/symbol_spec.rb +6 -6
  95. data/spec/{csv_decision → csv_decision2}/options_spec.rb +18 -18
  96. data/spec/csv_decision2/parse_spec.rb +44 -0
  97. data/spec/{csv_decision → csv_decision2}/table_spec.rb +17 -17
  98. data/spec/csv_decision2_spec.rb +7 -0
  99. metadata +64 -64
  100. data/lib/csv_decision.rb +0 -45
  101. data/spec/csv_decision/parse_spec.rb +0 -44
  102. data/spec/csv_decision_spec.rb +0 -7
@@ -1,23 +1,24 @@
1
1
  <!DOCTYPE html>
2
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::Header
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
  &mdash; 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
- pathId = "CSVDecision::Header";
19
- relpath = '../';
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
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../class_list.html?1"></iframe>
32
- <div id="resizer"></div>
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> &raquo;
42
+ <span class='title'><span class='object_link'><a href="../CSVDecision2.html"
43
+ title="CSVDecision (module)">CSVDecision</a></span></span>
44
+ &raquo;
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="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../_index.html">Index (H)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span>
41
- &raquo;
42
- <span class="title">Header</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>
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
- <div id="content"><h1>Module: CSVDecision::Header
63
-
64
-
65
- <span class="private note title">Private</span>
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/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&#39;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&#39;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
- <h2>Constant Summary</h2>
104
- <dl class="constants">
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
- </div>
118
- </div>
119
- <div class="tags">
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
- </div>
123
- </dt>
124
- <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>
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(?&lt;type&gt;in/text|in|out/text|out|guard|if|set/nil\?|set/blank\?|set|path)
126
131
  \s*:\s*(?&lt;name&gt;\S?.*)\z
127
- </span><span class='regexp_end'>}xi</span></span></pre></dd>
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
- <p>Regular expression string for a column name. More lenient than a Ruby
138
- method name - note any spaces will have been replaced with underscores.</p>
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'>&quot;</span><span class='tstring_content'>\\w[\\w:/!?]*</span><span class='tstring_end'>&quot;</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'>&quot;</span><span class='tstring_content'>\\w[\\w:/!?]*</span><span class='tstring_end'>&quot;</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
- <span class="summary_signature">
168
-
169
- <a href="#column_name%3F-class_method" title="column_name? (class method)">.<strong>column_name?</strong>(column_name) &#x21d2; Boolean </a>
170
-
171
-
172
-
173
- </span>
174
-
175
-
176
-
177
-
178
-
179
-
180
- <span class="private note title">private</span>
181
-
182
-
183
- <span class="summary_desc"><div class='inline'>
184
- <p>Return true if column name is valid.</p>
185
- </div></span>
186
-
187
- </li>
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) &#x21d2; 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
- <span class="summary_signature">
192
-
193
- <a href="#parse-class_method" title="parse (class method)">.<strong>parse</strong>(table:, matchers:) &#x21d2; CSVDecision::Columns </a>
194
-
195
-
196
-
197
- </span>
198
-
199
-
200
-
201
-
202
-
203
-
204
- <span class="private note title">private</span>
205
-
206
-
207
- <span class="summary_desc"><div class='inline'>
208
- <p>Parse the header row, and the defaults row if present.</p>
209
- </div></span>
210
-
211
- </li>
212
-
213
-
203
+ <span class="summary_signature">
204
+
205
+ <a href="#parse-class_method" title="parse (class method)">.<strong>parse</strong>(table:, matchers:)
206
+ &#x21d2; 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
- <span class="summary_signature">
216
-
217
- <a href="#row%3F-class_method" title="row? (class method)">.<strong>row?</strong>(row) &#x21d2; Boolean </a>
218
-
219
-
220
-
221
- </span>
222
-
223
-
224
-
225
-
226
-
227
-
228
- <span class="private note title">private</span>
229
-
230
-
231
- <span class="summary_desc"><div class='inline'>
232
- <p>Check if the given row contains a recognisable header cell.</p>
233
- </div></span>
234
-
235
- </li>
236
-
237
-
230
+ <span class="summary_signature">
231
+
232
+ <a href="#row%3F-class_method" title="row? (class method)">.<strong>row?</strong>(row) &#x21d2; 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
- <span class="summary_signature">
240
-
241
- <a href="#strip_empty_columns-class_method" title="strip_empty_columns (class method)">.<strong>strip_empty_columns</strong>(rows:) &#x21d2; Array&lt;Array&lt;String&gt;&gt; </a>
242
-
256
+ <span class="summary_signature">
243
257
 
244
-
245
- </span>
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:) &#x21d2;
260
+ Array&lt;Array&lt;String&gt;&gt; </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) &#x21d2; <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
- <p>Return true if column name is valid.</p>
271
+ <span class="private note title">private</span>
288
272
 
289
273
 
290
- </div>
291
- </div>
292
- <div class="tags">
293
- <p class="tag_title">Parameters:</p>
294
- <ul class="param">
295
-
296
- <li>
297
-
298
- <span class='name'>column_name</span>
299
-
300
-
301
- <span class='type'>(<tt>String</tt>)</span>
302
-
303
-
304
-
305
- </li>
306
-
307
- </ul>
308
-
309
- <p class="tag_title">Returns:</p>
310
- <ul class="return">
311
-
312
- <li>
313
-
314
-
315
- <span class='type'>(<tt>Boolean</tt>)</span>
316
-
317
-
318
-
319
- </li>
320
-
321
- </ul>
322
-
323
- </div><table class="source_code">
324
- <tr>
325
- <td>
326
- <pre class="lines">
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) &#x21d2; <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
- </td>
333
- <td>
334
- <pre class="code"><span class="info file"># File 'lib/csv_decision/header.rb', line 30</span>
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
- </td>
340
- </tr>
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:) &#x21d2; <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
- </div>
364
- </div>
365
- <div class="tags">
366
- <p class="tag_title">Parameters:</p>
367
- <ul class="param">
368
-
369
- <li>
370
-
371
- <span class='name'>table</span>
372
-
373
-
374
- <span class='type'>(<tt><span class='object_link'><a href="Table.html" title="CSVDecision::Table (class)">CSVDecision::Table</a></span></tt>)</span>
375
-
376
-
377
-
378
- &mdash;
379
- <div class='inline'>
380
- <p>Decision table being parsed.</p>
381
- </div>
382
-
383
- </li>
384
-
385
- <li>
386
-
387
- <span class='name'>matchers</span>
388
-
389
-
390
- <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Matchers/Matcher.html" title="CSVDecision::Matchers::Matcher (class)">Matchers::Matcher</a></span>&gt;</tt>)</span>
391
-
392
-
393
-
394
- &mdash;
395
- <div class='inline'>
396
- <p>Array of special cell matchers.</p>
397
- </div>
398
-
399
- </li>
400
-
401
- </ul>
402
-
403
- <p class="tag_title">Returns:</p>
404
- <ul class="return">
405
-
406
- <li>
407
-
408
-
409
- <span class='type'>(<tt><span class='object_link'><a href="Columns.html" title="CSVDecision::Columns (class)">CSVDecision::Columns</a></span></tt>)</span>
410
-
411
-
412
-
413
- &mdash;
414
- <div class='inline'>
415
- <p>Table columns object.</p>
416
- </div>
417
-
418
- </li>
419
-
420
- </ul>
421
-
422
- </div><table class="source_code">
423
- <tr>
424
- <td>
425
- <pre class="lines">
370
+ .<strong>parse</strong>(table:, matchers:) &#x21d2; <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
+ &mdash;
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&lt;<span class='object_link'><a href="Matchers/Matcher.html"
417
+ title="CSVDecision2::Matchers::Matcher (class)">Matchers::Matcher</a></span>&gt;</tt>)</span>
418
+
419
+
420
+
421
+ &mdash;
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
+ &mdash;
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
- </td>
441
- <td>
442
- <pre class="code"><span class="info file"># File 'lib/csv_decision/header.rb', line 59</span>
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="../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Columns.html" title="CSVDecision::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="CSVDecision::Columns#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='rparen'>)</span>
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="CSVDecision::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="CSVDecision::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>
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
- </td>
457
- </tr>
458
- </table>
459
- </div>
460
-
461
- <div class="method_details ">
462
- <h3 class="signature " id="row?-class_method">
463
-
464
- .<strong>row?</strong>(row) &#x21d2; <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
- </div>
481
- </div>
482
- <div class="tags">
483
- <p class="tag_title">Parameters:</p>
484
- <ul class="param">
485
-
486
- <li>
487
-
488
- <span class='name'>row</span>
489
-
490
-
491
- <span class='type'>(<tt>Array&lt;String&gt;</tt>)</span>
492
-
493
-
494
-
495
- &mdash;
496
- <div class='inline'>
497
- <p>Header row.</p>
498
- </div>
499
-
500
- </li>
501
-
502
- </ul>
503
-
504
- <p class="tag_title">Returns:</p>
505
- <ul class="return">
506
-
507
- <li>
508
-
509
-
510
- <span class='type'>(<tt>Boolean</tt>)</span>
511
-
512
-
513
-
514
- &mdash;
515
- <div class='inline'>
516
- <p>Return true if the row looks like a header.</p>
517
- </div>
518
-
519
- </li>
520
-
521
- </ul>
522
-
523
- </div><table class="source_code">
524
- <tr>
525
- <td>
526
- <pre class="lines">
493
+ .<strong>row?</strong>(row) &#x21d2; <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&lt;String&gt;</tt>)</span>
522
+
523
+
524
+
525
+ &mdash;
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
+ &mdash;
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
- </td>
533
- <td>
534
- <pre class="code"><span class="info file"># File 'lib/csv_decision/header.rb', line 38</span>
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="CSVDecision::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>
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
- </td>
540
- </tr>
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:) &#x21d2; <tt>Array&lt;Array&lt;String&gt;&gt;</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
- </div>
564
- </div>
565
- <div class="tags">
566
- <p class="tag_title">Parameters:</p>
567
- <ul class="param">
568
-
569
- <li>
570
-
571
- <span class='name'>rows</span>
572
-
573
-
574
- <span class='type'>(<tt>Array&lt;Array&lt;String&gt;&gt;</tt>)</span>
575
-
576
-
577
-
578
- &mdash;
579
- <div class='inline'>
580
- <p>Data rows.</p>
581
- </div>
582
-
583
- </li>
584
-
585
- </ul>
586
-
587
- <p class="tag_title">Returns:</p>
588
- <ul class="return">
589
-
590
- <li>
591
-
592
-
593
- <span class='type'>(<tt>Array&lt;Array&lt;String&gt;&gt;</tt>)</span>
594
-
595
-
596
-
597
- &mdash;
598
- <div class='inline'>
599
- <p>Data array after removing any empty columns and the header row.</p>
600
- </div>
601
-
602
- </li>
603
-
604
- </ul>
605
-
606
- </div><table class="source_code">
607
- <tr>
608
- <td>
609
- <pre class="lines">
578
+ .<strong>strip_empty_columns</strong>(rows:) &#x21d2; <tt>Array&lt;Array&lt;String&gt;&gt;</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&lt;Array&lt;String&gt;&gt;</tt>)</span>
607
+
608
+
609
+
610
+ &mdash;
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&lt;Array&lt;String&gt;&gt;</tt>)</span>
626
+
627
+
628
+
629
+ &mdash;
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
- </td>
620
- <td>
621
- <pre class="code"><span class="info file"># File 'lib/csv_decision/header.rb', line 47</span>
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="CSVDecision::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="CSVDecision::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>
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
- </td>
631
- </tr>
632
- </table>
633
- </div>
634
-
635
- </div>
663
+ </td>
664
+ </tr>
665
+ </table>
666
+ </div>
636
667
 
637
- </div>
668
+ </div>
638
669
 
639
- <div id="footer">
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
- </body>
647
- </html>
677
+
678
+ </div>
679
+ </body>
680
+
681
+ </html>