csv_decision2 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/README.md +16 -16
- data/benchmarks/rufus_decision.rb +5 -7
- data/csv_decision2.gemspec +2 -2
- data/doc/CSVDecision/CellValidationError.html +117 -110
- data/doc/CSVDecision/Columns/Default.html +537 -508
- data/doc/CSVDecision/Columns/Dictionary.html +729 -686
- data/doc/CSVDecision/Columns/Entry.html +457 -433
- data/doc/CSVDecision/Columns.html +1134 -1051
- data/doc/CSVDecision/Constant.html +205 -191
- data/doc/CSVDecision/Data.html +423 -398
- data/doc/CSVDecision/Decide.html +236 -225
- data/doc/CSVDecision/Decision.html +872 -825
- data/doc/CSVDecision/Defaults.html +243 -230
- data/doc/CSVDecision/Dictionary/Entry.html +1026 -964
- data/doc/CSVDecision/Dictionary.html +377 -355
- data/doc/CSVDecision/Error.html +116 -105
- data/doc/CSVDecision/FileError.html +117 -110
- data/doc/CSVDecision/Function.html +181 -168
- data/doc/CSVDecision/Guard.html +200 -185
- data/doc/CSVDecision/Header.html +557 -523
- data/doc/CSVDecision/Index.html +652 -617
- data/doc/CSVDecision/Input.html +329 -312
- data/doc/CSVDecision/Load.html +232 -220
- data/doc/CSVDecision/Matchers/Constant.html +432 -399
- data/doc/CSVDecision/Matchers/Function.html +451 -415
- data/doc/CSVDecision/Matchers/Guard.html +459 -424
- data/doc/CSVDecision/Matchers/Matcher.html +470 -426
- data/doc/CSVDecision/Matchers/Numeric.html +375 -346
- data/doc/CSVDecision/Matchers/Pattern.html +429 -396
- data/doc/CSVDecision/Matchers/Proc.html +617 -575
- data/doc/CSVDecision/Matchers/Range.html +331 -302
- data/doc/CSVDecision/Matchers/Symbol.html +386 -353
- data/doc/CSVDecision/Matchers.html +1509 -1393
- data/doc/CSVDecision/Numeric.html +201 -188
- data/doc/CSVDecision/Options.html +376 -357
- data/doc/CSVDecision/Parse.html +217 -204
- data/doc/CSVDecision/Paths.html +664 -629
- data/doc/CSVDecision/Result.html +1076 -1005
- data/doc/CSVDecision/Scan/InputHashes.html +305 -288
- data/doc/CSVDecision/Scan.html +262 -249
- data/doc/CSVDecision/ScanRow.html +749 -705
- data/doc/CSVDecision/Symbol.html +204 -191
- data/doc/CSVDecision/Table.html +1391 -1305
- data/doc/CSVDecision/TableValidationError.html +117 -110
- data/doc/CSVDecision/Validate.html +353 -337
- data/doc/CSVDecision.html +623 -552
- data/doc/_index.html +488 -448
- data/doc/class_list.html +250 -45
- data/doc/file.README.html +304 -278
- data/doc/index.html +304 -278
- data/doc/method_list.html +1159 -1017
- data/doc/top-level-namespace.html +79 -75
- data/lib/{csv_decision → csv_decision2}/columns.rb +7 -7
- data/lib/{csv_decision → csv_decision2}/data.rb +1 -1
- data/lib/{csv_decision → csv_decision2}/decision.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/defaults.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/dictionary.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/header.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/index.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/input.rb +3 -3
- data/lib/{csv_decision → csv_decision2}/load.rb +6 -6
- data/lib/{csv_decision → csv_decision2}/matchers/constant.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/function.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/guard.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/numeric.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/pattern.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/range.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers/symbol.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/matchers.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/options.rb +3 -3
- data/lib/{csv_decision → csv_decision2}/parse.rb +14 -14
- data/lib/{csv_decision → csv_decision2}/paths.rb +5 -5
- data/lib/{csv_decision → csv_decision2}/result.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/scan.rb +3 -3
- data/lib/{csv_decision → csv_decision2}/scan_row.rb +2 -2
- data/lib/{csv_decision → csv_decision2}/table.rb +8 -8
- data/lib/{csv_decision → csv_decision2}/validate.rb +2 -2
- data/lib/csv_decision2.rb +45 -0
- data/spec/{csv_decision → csv_decision2}/columns_spec.rb +44 -44
- data/spec/{csv_decision → csv_decision2}/constant_spec.rb +4 -4
- data/spec/{csv_decision → csv_decision2}/data_spec.rb +11 -11
- data/spec/{csv_decision → csv_decision2}/decision_spec.rb +6 -6
- data/spec/{csv_decision → csv_decision2}/examples_spec.rb +14 -14
- data/spec/{csv_decision → csv_decision2}/index_spec.rb +8 -8
- data/spec/{csv_decision → csv_decision2}/input_spec.rb +9 -9
- data/spec/{csv_decision → csv_decision2}/load_spec.rb +8 -8
- data/spec/{csv_decision → csv_decision2}/matchers/function_spec.rb +7 -7
- data/spec/{csv_decision → csv_decision2}/matchers/guard_spec.rb +14 -14
- data/spec/{csv_decision → csv_decision2}/matchers/numeric_spec.rb +5 -5
- data/spec/{csv_decision → csv_decision2}/matchers/pattern_spec.rb +6 -6
- data/spec/{csv_decision → csv_decision2}/matchers/range_spec.rb +5 -5
- data/spec/{csv_decision → csv_decision2}/matchers/symbol_spec.rb +6 -6
- data/spec/{csv_decision → csv_decision2}/options_spec.rb +18 -18
- data/spec/csv_decision2/parse_spec.rb +44 -0
- data/spec/{csv_decision → csv_decision2}/table_spec.rb +17 -17
- data/spec/csv_decision2_spec.rb +7 -0
- metadata +64 -64
- data/lib/csv_decision.rb +0 -45
- data/spec/csv_decision/parse_spec.rb +0 -44
- data/spec/csv_decision_spec.rb +0 -7
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<meta
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>
|
|
8
|
+
Module: CSVDecision2::Options
|
|
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::Options";
|
|
20
|
+
relpath = '../';
|
|
21
|
+
</script>
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
@@ -25,113 +26,119 @@
|
|
|
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 (O)</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">Options</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::Options
|
|
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/options.rb</dd>
|
|
85
|
+
</dl>
|
|
86
|
+
|
|
60
87
|
</div>
|
|
61
88
|
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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>
|
|
69
96
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
97
|
+
<p>Validate and normalize the options values supplied.</p>
|
|
75
98
|
|
|
76
|
-
|
|
77
99
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<dd>lib/csv_decision/options.rb</dd>
|
|
82
|
-
</dl>
|
|
83
|
-
|
|
84
|
-
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="tags">
|
|
85
103
|
|
|
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
104
|
|
|
93
|
-
|
|
105
|
+
</div>
|
|
106
|
+
<h2>Constant Summary</h2>
|
|
107
|
+
<dl class="constants">
|
|
94
108
|
|
|
109
|
+
<dt id="DEFAULT_MATCHERS-constant" class="">DEFAULT_MATCHERS =
|
|
110
|
+
<div class="docstring">
|
|
111
|
+
<div class="discussion">
|
|
112
|
+
<p class="note private">
|
|
113
|
+
<strong>This constant is part of a private API.</strong>
|
|
114
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
115
|
+
</p>
|
|
95
116
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</div>
|
|
102
|
-
<h2>Constant Summary</h2>
|
|
103
|
-
<dl class="constants">
|
|
104
|
-
|
|
105
|
-
<dt id="DEFAULT_MATCHERS-constant" class="">DEFAULT_MATCHERS =
|
|
106
|
-
<div class="docstring">
|
|
107
|
-
<div class="discussion">
|
|
108
|
-
<p class="note private">
|
|
109
|
-
<strong>This constant is part of a private API.</strong>
|
|
110
|
-
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
111
|
-
</p>
|
|
112
|
-
|
|
113
|
-
<p>Specialized cell value matchers beyond simple string compares. By default
|
|
114
|
-
all these matchers are tried in the specified order on all input data
|
|
115
|
-
cells.</p>
|
|
117
|
+
<p>Specialized cell value matchers beyond simple string compares. By default
|
|
118
|
+
all these matchers are tried in the specified order on all input data
|
|
119
|
+
cells.</p>
|
|
116
120
|
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
</div>
|
|
120
|
-
<div class="tags">
|
|
121
|
-
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
<div class="tags">
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
</div>
|
|
128
|
+
</dt>
|
|
129
|
+
<dd>
|
|
130
|
+
<pre
|
|
131
|
+
class="code"><span class='lbracket'>[</span>
|
|
132
|
+
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision2::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Range.html" title="CSVDecision2::Matchers::Range (class)">Range</a></span></span><span class='comma'>,</span>
|
|
133
|
+
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision2::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Numeric.html" title="CSVDecision2::Matchers::Numeric (class)">Numeric</a></span></span><span class='comma'>,</span>
|
|
134
|
+
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision2::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Pattern.html" title="CSVDecision2::Matchers::Pattern (class)">Pattern</a></span></span><span class='comma'>,</span>
|
|
135
|
+
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision2::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Constant.html" title="CSVDecision2::Matchers::Constant (class)">Constant</a></span></span><span class='comma'>,</span>
|
|
136
|
+
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision2::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Symbol.html" title="CSVDecision2::Matchers::Symbol (class)">Symbol</a></span></span><span class='comma'>,</span>
|
|
137
|
+
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision2::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Guard.html" title="CSVDecision2::Matchers::Guard (class)">Guard</a></span></span>
|
|
138
|
+
<span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre>
|
|
139
|
+
</dd>
|
|
122
140
|
|
|
123
|
-
</
|
|
124
|
-
</dt>
|
|
125
|
-
<dd><pre class="code"><span class='lbracket'>[</span>
|
|
126
|
-
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Range.html" title="CSVDecision::Matchers::Range (class)">Range</a></span></span><span class='comma'>,</span>
|
|
127
|
-
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Numeric.html" title="CSVDecision::Matchers::Numeric (class)">Numeric</a></span></span><span class='comma'>,</span>
|
|
128
|
-
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Pattern.html" title="CSVDecision::Matchers::Pattern (class)">Pattern</a></span></span><span class='comma'>,</span>
|
|
129
|
-
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Constant.html" title="CSVDecision::Matchers::Constant (class)">Constant</a></span></span><span class='comma'>,</span>
|
|
130
|
-
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span></span><span class='comma'>,</span>
|
|
131
|
-
<span class='const'><span class='object_link'><a href="Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Matchers/Guard.html" title="CSVDecision::Matchers::Guard (class)">Guard</a></span></span>
|
|
132
|
-
<span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
133
|
-
|
|
134
|
-
</dl>
|
|
141
|
+
</dl>
|
|
135
142
|
|
|
136
143
|
|
|
137
144
|
|
|
@@ -139,154 +146,162 @@ cells.</p>
|
|
|
139
146
|
|
|
140
147
|
|
|
141
148
|
|
|
142
|
-
|
|
143
|
-
<h2>
|
|
144
|
-
Class Method Summary
|
|
145
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
146
|
-
</h2>
|
|
147
149
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
<h2>
|
|
151
|
+
Class Method Summary
|
|
152
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
153
|
+
</h2>
|
|
154
|
+
|
|
155
|
+
<ul class="summary">
|
|
156
|
+
|
|
150
157
|
<li class="public ">
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
</
|
|
172
|
-
|
|
173
|
-
|
|
158
|
+
<span class="summary_signature">
|
|
159
|
+
|
|
160
|
+
<a href="#from_csv-class_method" title="from_csv (class method)">.<strong>from_csv</strong>(rows:, options:)
|
|
161
|
+
⇒ Hash </a>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
</span>
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
<span class="private note title">private</span>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
<span class="summary_desc">
|
|
176
|
+
<div class='inline'>
|
|
177
|
+
<p>Read any options supplied in the CSV file placed before the header row.</p>
|
|
178
|
+
</div>
|
|
179
|
+
</span>
|
|
180
|
+
|
|
181
|
+
</li>
|
|
182
|
+
|
|
183
|
+
|
|
174
184
|
<li class="public ">
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
<
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
</
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
</h3><div class="docstring">
|
|
218
|
-
<div class="discussion">
|
|
219
|
-
<p class="note private">
|
|
220
|
-
<strong>This method is part of a private API.</strong>
|
|
221
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
222
|
-
</p>
|
|
223
|
-
|
|
224
|
-
<p>Read any options supplied in the CSV file placed before the header row.</p>
|
|
185
|
+
<span class="summary_signature">
|
|
186
|
+
|
|
187
|
+
<a href="#normalize-class_method" title="normalize (class method)">.<strong>normalize</strong>(options)
|
|
188
|
+
⇒ Hash </a>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
</span>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
<span class="private note title">private</span>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
<span class="summary_desc">
|
|
203
|
+
<div class='inline'>
|
|
204
|
+
<p>Validate options and supply default values for any options not explicitly
|
|
205
|
+
set.</p>
|
|
206
|
+
</div>
|
|
207
|
+
</span>
|
|
208
|
+
|
|
209
|
+
</li>
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
</ul>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
<div id="class_method_details" class="method_details_list">
|
|
218
|
+
<h2>Class Method Details</h2>
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
<div class="method_details first">
|
|
222
|
+
<h3 class="signature first" id="from_csv-class_method">
|
|
223
|
+
|
|
224
|
+
.<strong>from_csv</strong>(rows:, options:) ⇒ <tt>Hash</tt>
|
|
225
|
+
|
|
225
226
|
|
|
226
227
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
<
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
<
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
</h3>
|
|
231
|
+
<div class="docstring">
|
|
232
|
+
<div class="discussion">
|
|
233
|
+
<p class="note private">
|
|
234
|
+
<strong>This method is part of a private API.</strong>
|
|
235
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
236
|
+
</p>
|
|
237
|
+
|
|
238
|
+
<p>Read any options supplied in the CSV file placed before the header row.</p>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
<div class="tags">
|
|
244
|
+
<p class="tag_title">Parameters:</p>
|
|
245
|
+
<ul class="param">
|
|
246
|
+
|
|
247
|
+
<li>
|
|
248
|
+
|
|
249
|
+
<span class='name'>rows</span>
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
<span class='type'>(<tt>Array<Array<String>></tt>)</span>
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
—
|
|
257
|
+
<div class='inline'>
|
|
258
|
+
<p>Table data rows.</p>
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
</li>
|
|
262
|
+
|
|
263
|
+
<li>
|
|
264
|
+
|
|
265
|
+
<span class='name'>options</span>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
—
|
|
273
|
+
<div class='inline'>
|
|
274
|
+
<p>Input options hash built so far.</p>
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
</li>
|
|
278
|
+
|
|
279
|
+
</ul>
|
|
280
|
+
|
|
281
|
+
<p class="tag_title">Returns:</p>
|
|
282
|
+
<ul class="return">
|
|
283
|
+
|
|
284
|
+
<li>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
—
|
|
292
|
+
<div class='inline'>
|
|
293
|
+
<p>Options hash overridden with any values found in the CSV file.</p>
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
</li>
|
|
297
|
+
|
|
298
|
+
</ul>
|
|
299
|
+
|
|
300
|
+
</div>
|
|
301
|
+
<table class="source_code">
|
|
302
|
+
<tr>
|
|
303
|
+
<td>
|
|
304
|
+
<pre class="lines">
|
|
290
305
|
|
|
291
306
|
|
|
292
307
|
56
|
|
@@ -302,16 +317,16 @@ set.</p>
|
|
|
302
317
|
66
|
|
303
318
|
67
|
|
304
319
|
68</pre>
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
320
|
+
</td>
|
|
321
|
+
<td>
|
|
322
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/options.rb', line 56</span>
|
|
308
323
|
|
|
309
324
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_from_csv'>from_csv</span><span class='lparen'>(</span><span class='label'>rows:</span><span class='comma'>,</span> <span class='label'>options:</span><span class='rparen'>)</span>
|
|
310
325
|
<span class='id identifier rubyid_row'>row</span> <span class='op'>=</span> <span class='id identifier rubyid_rows'>rows</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
|
311
326
|
<span class='kw'>return</span> <span class='id identifier rubyid_options'>options</span> <span class='kw'>if</span> <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
312
327
|
|
|
313
328
|
<span class='comment'># Have we hit the header row?
|
|
314
|
-
</span> <span class='kw'>return</span> <span class='id identifier rubyid_options'>options</span> <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="Header.html" title="
|
|
329
|
+
</span> <span class='kw'>return</span> <span class='id identifier rubyid_options'>options</span> <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="Header.html" title="CSVDecision2::Header (module)">Header</a></span></span><span class='period'>.</span><span class='id identifier rubyid_row?'><span class='object_link'><a href="Header.html#row%3F-class_method" title="CSVDecision2::Header.row? (method)">row?</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
|
|
315
330
|
|
|
316
331
|
<span class='comment'># Scan each cell looking for valid option values
|
|
317
332
|
</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_scan_cells'>scan_cells</span><span class='lparen'>(</span><span class='label'>row:</span> <span class='id identifier rubyid_row'>row</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
@@ -319,125 +334,129 @@ set.</p>
|
|
|
319
334
|
<span class='id identifier rubyid_rows'>rows</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span>
|
|
320
335
|
<span class='id identifier rubyid_from_csv'>from_csv</span><span class='lparen'>(</span><span class='label'>rows:</span> <span class='id identifier rubyid_rows'>rows</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
321
336
|
<span class='kw'>end</span></pre>
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
</table>
|
|
325
|
-
</div>
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
</h3><div class="docstring">
|
|
337
|
-
<div class="discussion">
|
|
338
|
-
<p class="note private">
|
|
339
|
-
<strong>This method is part of a private API.</strong>
|
|
340
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
341
|
-
</p>
|
|
342
|
-
|
|
343
|
-
<p>Validate options and supply default values for any options not explicitly
|
|
344
|
-
set.</p>
|
|
337
|
+
</td>
|
|
338
|
+
</tr>
|
|
339
|
+
</table>
|
|
340
|
+
</div>
|
|
341
|
+
|
|
342
|
+
<div class="method_details ">
|
|
343
|
+
<h3 class="signature " id="normalize-class_method">
|
|
344
|
+
|
|
345
|
+
.<strong>normalize</strong>(options) ⇒ <tt>Hash</tt>
|
|
346
|
+
|
|
347
|
+
|
|
345
348
|
|
|
346
349
|
|
|
347
|
-
|
|
348
|
-
</
|
|
349
|
-
<div class="
|
|
350
|
-
|
|
351
|
-
<
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
<
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
<
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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
|
-
|
|
350
|
+
|
|
351
|
+
</h3>
|
|
352
|
+
<div class="docstring">
|
|
353
|
+
<div class="discussion">
|
|
354
|
+
<p class="note private">
|
|
355
|
+
<strong>This method is part of a private API.</strong>
|
|
356
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
357
|
+
</p>
|
|
358
|
+
|
|
359
|
+
<p>Validate options and supply default values for any options not explicitly
|
|
360
|
+
set.</p>
|
|
361
|
+
|
|
362
|
+
|
|
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'>options</span>
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
—
|
|
379
|
+
<div class='inline'>
|
|
380
|
+
<p>Input options hash supplied by the user.</p>
|
|
381
|
+
</div>
|
|
382
|
+
|
|
383
|
+
</li>
|
|
384
|
+
|
|
385
|
+
</ul>
|
|
386
|
+
|
|
387
|
+
<p class="tag_title">Returns:</p>
|
|
388
|
+
<ul class="return">
|
|
389
|
+
|
|
390
|
+
<li>
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
—
|
|
398
|
+
<div class='inline'>
|
|
399
|
+
<p>Options hash filled in with all required values, defaulted if necessary.</p>
|
|
400
|
+
</div>
|
|
401
|
+
|
|
402
|
+
</li>
|
|
403
|
+
|
|
404
|
+
</ul>
|
|
405
|
+
<p class="tag_title">Raises:</p>
|
|
406
|
+
<ul class="raise">
|
|
407
|
+
|
|
408
|
+
<li>
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
<span class='type'>(<tt><span class='object_link'><a href="CellValidationError.html"
|
|
412
|
+
title="CSVDecision2::CellValidationError (class)">CellValidationError</a></span></tt>)</span>
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
—
|
|
417
|
+
<div class='inline'>
|
|
418
|
+
<p>For invalid option keys.</p>
|
|
419
|
+
</div>
|
|
420
|
+
|
|
421
|
+
</li>
|
|
422
|
+
|
|
423
|
+
</ul>
|
|
424
|
+
|
|
425
|
+
</div>
|
|
426
|
+
<table class="source_code">
|
|
427
|
+
<tr>
|
|
428
|
+
<td>
|
|
429
|
+
<pre class="lines">
|
|
412
430
|
|
|
413
431
|
|
|
414
432
|
46
|
|
415
433
|
47
|
|
416
434
|
48
|
|
417
435
|
49</pre>
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
436
|
+
</td>
|
|
437
|
+
<td>
|
|
438
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision2/options.rb', line 46</span>
|
|
421
439
|
|
|
422
440
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_normalize'>normalize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
423
441
|
<span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
424
442
|
<span class='id identifier rubyid_default'>default</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
425
443
|
<span class='kw'>end</span></pre>
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
</table>
|
|
429
|
-
</div>
|
|
430
|
-
|
|
431
|
-
</div>
|
|
444
|
+
</td>
|
|
445
|
+
</tr>
|
|
446
|
+
</table>
|
|
447
|
+
</div>
|
|
432
448
|
|
|
433
|
-
</div>
|
|
449
|
+
</div>
|
|
434
450
|
|
|
435
|
-
|
|
436
|
-
Generated on Sun Feb 11 10:26:07 2018 by
|
|
437
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
438
|
-
0.9.12 (ruby-2.4.0).
|
|
439
|
-
</div>
|
|
451
|
+
</div>
|
|
440
452
|
|
|
453
|
+
<div id="footer">
|
|
454
|
+
Generated on Sun Feb 11 10:26:07 2018 by
|
|
455
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
456
|
+
0.9.12 (ruby-2.4.0).
|
|
441
457
|
</div>
|
|
442
|
-
|
|
443
|
-
</
|
|
458
|
+
|
|
459
|
+
</div>
|
|
460
|
+
</body>
|
|
461
|
+
|
|
462
|
+
</html>
|