csv_decision 0.4.1 → 0.5.0
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/CHANGELOG.md +4 -0
- data/README.md +43 -19
- data/csv_decision.gemspec +1 -1
- data/doc/CSVDecision.html +6 -6
- data/doc/CSVDecision/CellValidationError.html +1 -1
- data/doc/CSVDecision/Columns.html +124 -42
- data/doc/CSVDecision/Columns/Dictionary.html +101 -7
- data/doc/CSVDecision/Data.html +1 -1
- data/doc/CSVDecision/Decision.html +444 -98
- data/doc/CSVDecision/Defaults.html +1 -1
- data/doc/CSVDecision/Dictionary.html +4 -4
- data/doc/CSVDecision/Dictionary/Entry.html +31 -31
- data/doc/CSVDecision/Error.html +1 -1
- data/doc/CSVDecision/FileError.html +1 -1
- data/doc/CSVDecision/Header.html +2 -2
- data/doc/CSVDecision/Index.html +1 -1
- data/doc/CSVDecision/Input.html +129 -3
- data/doc/CSVDecision/Load.html +1 -1
- data/doc/CSVDecision/Matchers.html +168 -41
- data/doc/CSVDecision/Matchers/Constant.html +7 -7
- data/doc/CSVDecision/Matchers/Function.html +1 -1
- data/doc/CSVDecision/Matchers/Guard.html +16 -16
- data/doc/CSVDecision/Matchers/Matcher.html +13 -13
- data/doc/CSVDecision/Matchers/Numeric.html +8 -14
- data/doc/CSVDecision/Matchers/Pattern.html +10 -10
- data/doc/CSVDecision/Matchers/Proc.html +1 -1
- data/doc/CSVDecision/Matchers/Range.html +1 -1
- data/doc/CSVDecision/Matchers/Symbol.html +19 -29
- data/doc/CSVDecision/Options.html +1 -1
- data/doc/CSVDecision/Parse.html +4 -4
- data/doc/CSVDecision/Paths.html +742 -0
- data/doc/CSVDecision/Result.html +139 -70
- data/doc/CSVDecision/Scan.html +313 -0
- data/doc/CSVDecision/Scan/InputHashes.html +369 -0
- data/doc/CSVDecision/ScanRow.html +1 -1
- data/doc/CSVDecision/Table.html +134 -52
- data/doc/CSVDecision/TableValidationError.html +1 -1
- data/doc/CSVDecision/Validate.html +1 -1
- data/doc/_index.html +26 -5
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +50 -28
- data/doc/index.html +50 -28
- data/doc/method_list.html +234 -98
- data/doc/top-level-namespace.html +1 -1
- data/lib/csv_decision.rb +3 -0
- data/lib/csv_decision/columns.rb +11 -0
- data/lib/csv_decision/decision.rb +82 -56
- data/lib/csv_decision/dictionary.rb +5 -1
- data/lib/csv_decision/header.rb +1 -1
- data/lib/csv_decision/input.rb +14 -11
- data/lib/csv_decision/parse.rb +6 -2
- data/lib/csv_decision/paths.rb +78 -0
- data/lib/csv_decision/result.rb +42 -35
- data/lib/csv_decision/scan.rb +116 -0
- data/lib/csv_decision/table.rb +18 -7
- data/lib/csv_decision/validate.rb +1 -1
- data/spec/csv_decision/columns_spec.rb +14 -0
- data/spec/csv_decision/decision_spec.rb +1 -3
- data/spec/csv_decision/examples_spec.rb +25 -0
- data/spec/csv_decision/table_spec.rb +87 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff2fef716b98e6c7e35b1ff4e6d60adf92747295
|
4
|
+
data.tar.gz: bc4c0f940707518e82019b7aa0d16f0107ec01d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb2d0b990168df3597d3131e48fc1ee8c620fe3b886acb23ffa71eabde146d9e2f7425f927ac74c02fc3e3acfbd2f56eae1a46bbeaf2fef614669b9a28dc6e24
|
7
|
+
data.tar.gz: 2a7beb77db22e035bdb36cb34ad1a96e22078afdd4974e0f7b7ebcda9465d5c04999cb0882b47534b3fc372bb45b76c384df77363cfd71d00ab8a5c11dfbbd87
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -47,8 +47,7 @@ To get started, just add `csv_decision` to your `Gemfile`, and then run `bundle`
|
|
47
47
|
### Simple example
|
48
48
|
|
49
49
|
This table considers two input conditions: `topic` and `region`, labeled `in:`.
|
50
|
-
Certain combinations yield an output value for `team_member`,
|
51
|
-
labeled `out:`.
|
50
|
+
Certain combinations yield an output value for `team_member`, labeled `out:`.
|
52
51
|
|
53
52
|
```
|
54
53
|
in:topic | in:region | out:team_member
|
@@ -65,10 +64,8 @@ politics | | Henry
|
|
65
64
|
```
|
66
65
|
|
67
66
|
When the topic is `finance` and the region is `Europe` the team member `Donald`
|
68
|
-
is selected.
|
69
|
-
|
70
|
-
This is a "first match" decision table in that as soon as a match is made execution
|
71
|
-
stops and a single output row (hash) is returned.
|
67
|
+
is selected. This is a "first match" decision table in that as soon as a match is made
|
68
|
+
execution stops and a single output row (hash) is returned.
|
72
69
|
|
73
70
|
The ordering of rows matters. `Ernest`, who is in charge of `finance` for the rest of
|
74
71
|
the world, except for `America` and `Europe`, *must* come after his colleagues
|
@@ -99,7 +96,7 @@ Here's the example as code:
|
|
99
96
|
table.decide(topic: 'culture', region: 'America') #=> { team_member: 'Zach' }
|
100
97
|
```
|
101
98
|
|
102
|
-
An empty `in:` cell means "matches any value"
|
99
|
+
An empty `in:` cell means "matches any value".
|
103
100
|
|
104
101
|
Note that all column header names are symbolized, so it's actually more accurate to write
|
105
102
|
`in :topic`; however spaces before and after the `:` do not matter.
|
@@ -124,23 +121,21 @@ Complete documentation of all table parameters is in the code - see
|
|
124
121
|
`lib/csv_decision/parse.rb` and `lib/csv_decision/table.rb`.
|
125
122
|
|
126
123
|
### CSV Decision features
|
127
|
-
* Either returns the first matching row as a hash (default), or accumulates all matches
|
128
|
-
array of hashes (i.e., `parse` option `first_match: false` or CSV file option
|
124
|
+
* Either returns the first matching row as a hash (default), or accumulates all matches
|
125
|
+
as an array of hashes (i.e., `parse` option `first_match: false` or CSV file option
|
126
|
+
`accumulate`).
|
129
127
|
* Fast decision-time performance (see `benchmarks` folder). Automatically indexes all
|
130
128
|
constants-only columns that do not contain any empty strings.
|
131
|
-
* In addition to
|
129
|
+
* In addition to strings, can match basic Ruby constants (e.g., `=nil`),
|
132
130
|
regular expressions (e.g., `=~ on|off`), comparisons (e.g., `> 100.0` ) and
|
133
131
|
Ruby-style ranges (e.g., `1..10`)
|
134
132
|
* Can compare an input column versus another input hash key - e.g., `> :column`.
|
135
|
-
* Any cell starting with `#` is treated as a comment, and comments may appear anywhere in
|
136
|
-
|
137
|
-
*
|
133
|
+
* Any cell starting with `#` is treated as a comment, and comments may appear anywhere in
|
134
|
+
the table.
|
135
|
+
* Column symbol expressions or Ruby methods (0-arity) may be used in input columns for
|
138
136
|
matching - e.g., `:column.zero?` or `:column == 0`.
|
139
137
|
* May also use Ruby methods in output columns - e.g., `:column.length`.
|
140
|
-
* Accepts data as a file, CSV string or an array of arrays.
|
141
|
-
force encoded to UTF-8, and non-ascii strings are converted to empty strings.)
|
142
|
-
* All CSV cells are parsed for correctness, and helpful error messages generated for bad
|
143
|
-
input.
|
138
|
+
* Accepts data as a file, CSV string or an array of arrays.
|
144
139
|
|
145
140
|
#### Constants other than strings
|
146
141
|
Although `csv_decision` is string oriented, it does recognise other types of constant
|
@@ -186,8 +181,8 @@ For example:
|
|
186
181
|
|
187
182
|
Note that there is no need to include an input column for `:node` in the decision
|
188
183
|
table - it just needs to be present in the input hash. The expression, `== :node` should be
|
189
|
-
read as `:parent == :node`. It can also be shortened to just `:node`, so the above decision
|
190
|
-
may be simplified to:
|
184
|
+
read as `:parent == :node`. It can also be shortened to just `:node`, so the above decision
|
185
|
+
table may be simplified to:
|
191
186
|
|
192
187
|
```ruby
|
193
188
|
data = <<~DATA
|
@@ -274,6 +269,35 @@ table.decide(ISIN: '123456789012', country: 'GB', class: 'private') #=> {PAID: '
|
|
274
269
|
|
275
270
|
```
|
276
271
|
|
272
|
+
#### Input `path` columns
|
273
|
+
|
274
|
+
For hashes that contain sub-hashes, it's possible to specify a path for the purposes
|
275
|
+
of matching. (Arrays are currently not supported.)
|
276
|
+
|
277
|
+
```ruby
|
278
|
+
data = <<~DATA
|
279
|
+
path:, path:, out :value
|
280
|
+
header, , :source_name
|
281
|
+
header, metrics, :service_name
|
282
|
+
payload, , :amount
|
283
|
+
payload, ref_data, :account_id
|
284
|
+
DATA
|
285
|
+
table = CSVDecision.parse(data, first_match: false)
|
286
|
+
|
287
|
+
input = {
|
288
|
+
header: {
|
289
|
+
id: 1, type_cd: 'BUY', source_name: 'Client', client_name: 'AAPL',
|
290
|
+
metrics: { service_name: 'Trading', receive_time: '12:00' }
|
291
|
+
},
|
292
|
+
payload: {
|
293
|
+
tran_id: 9, amount: '100.00',
|
294
|
+
ref_data: { account_id: '5010', type_id: 'BUYL' }
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
table.decide(input) #=> { value: %w[Client Trading 100.00 5010] }
|
299
|
+
```
|
300
|
+
|
277
301
|
### Testing
|
278
302
|
|
279
303
|
`csv_decision` includes thorough [RSpec](http://rspec.info) tests:
|
data/csv_decision.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'csv_decision'
|
8
|
-
spec.version = '0.
|
8
|
+
spec.version = '0.5.0'
|
9
9
|
spec.authors = ['Brett Vickers']
|
10
10
|
spec.email = ['brett@phillips-vickers.com']
|
11
11
|
spec.description = 'CSV based Ruby decision tables.'
|
data/doc/CSVDecision.html
CHANGED
@@ -79,7 +79,7 @@
|
|
79
79
|
<dl>
|
80
80
|
<dt>Defined in:</dt>
|
81
81
|
<dd>lib/csv_decision.rb<span class="defines">,<br />
|
82
|
-
lib/csv_decision/data.rb,<br /> lib/csv_decision/load.rb,<br /> lib/csv_decision/index.rb,<br /> lib/csv_decision/input.rb,<br /> lib/csv_decision/parse.rb,<br /> lib/csv_decision/table.rb,<br /> lib/csv_decision/header.rb,<br /> lib/csv_decision/result.rb,<br /> lib/csv_decision/columns.rb,<br /> lib/csv_decision/options.rb,<br /> lib/csv_decision/decision.rb,<br /> lib/csv_decision/defaults.rb,<br /> lib/csv_decision/matchers.rb,<br /> lib/csv_decision/scan_row.rb,<br /> lib/csv_decision/validate.rb,<br /> lib/csv_decision/dictionary.rb,<br /> lib/csv_decision/matchers/guard.rb,<br /> lib/csv_decision/matchers/range.rb,<br /> lib/csv_decision/matchers/symbol.rb,<br /> lib/csv_decision/matchers/numeric.rb,<br /> lib/csv_decision/matchers/pattern.rb,<br /> lib/csv_decision/matchers/constant.rb,<br /> lib/csv_decision/matchers/function.rb</span>
|
82
|
+
lib/csv_decision/data.rb,<br /> lib/csv_decision/load.rb,<br /> lib/csv_decision/scan.rb,<br /> lib/csv_decision/index.rb,<br /> lib/csv_decision/input.rb,<br /> lib/csv_decision/parse.rb,<br /> lib/csv_decision/paths.rb,<br /> lib/csv_decision/table.rb,<br /> lib/csv_decision/header.rb,<br /> lib/csv_decision/result.rb,<br /> lib/csv_decision/columns.rb,<br /> lib/csv_decision/options.rb,<br /> lib/csv_decision/decision.rb,<br /> lib/csv_decision/defaults.rb,<br /> lib/csv_decision/matchers.rb,<br /> lib/csv_decision/scan_row.rb,<br /> lib/csv_decision/validate.rb,<br /> lib/csv_decision/dictionary.rb,<br /> lib/csv_decision/matchers/guard.rb,<br /> lib/csv_decision/matchers/range.rb,<br /> lib/csv_decision/matchers/symbol.rb,<br /> lib/csv_decision/matchers/numeric.rb,<br /> lib/csv_decision/matchers/pattern.rb,<br /> lib/csv_decision/matchers/constant.rb,<br /> lib/csv_decision/matchers/function.rb</span>
|
83
83
|
</dd>
|
84
84
|
</dl>
|
85
85
|
|
@@ -121,7 +121,7 @@ LICENSE and README.md for details.</p>
|
|
121
121
|
|
122
122
|
|
123
123
|
|
124
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="CSVDecision/CellValidationError.html" title="CSVDecision::CellValidationError (class)">CellValidationError</a></span>, <span class='object_link'><a href="CSVDecision/Columns.html" title="CSVDecision::Columns (class)">Columns</a></span>, <span class='object_link'><a href="CSVDecision/Decision.html" title="CSVDecision::Decision (class)">Decision</a></span>, <span class='object_link'><a href="CSVDecision/Error.html" title="CSVDecision::Error (class)">Error</a></span>, <span class='object_link'><a href="CSVDecision/FileError.html" title="CSVDecision::FileError (class)">FileError</a></span>, <span class='object_link'><a href="CSVDecision/Index.html" title="CSVDecision::Index (class)">Index</a></span>, <span class='object_link'><a href="CSVDecision/Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span>, <span class='object_link'><a href="CSVDecision/Result.html" title="CSVDecision::Result (class)">Result</a></span>, <span class='object_link'><a href="CSVDecision/ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>, <span class='object_link'><a href="CSVDecision/Table.html" title="CSVDecision::Table (class)">Table</a></span>, <span class='object_link'><a href="CSVDecision/TableValidationError.html" title="CSVDecision::TableValidationError (class)">TableValidationError</a></span>
|
124
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="CSVDecision/CellValidationError.html" title="CSVDecision::CellValidationError (class)">CellValidationError</a></span>, <span class='object_link'><a href="CSVDecision/Columns.html" title="CSVDecision::Columns (class)">Columns</a></span>, <span class='object_link'><a href="CSVDecision/Decision.html" title="CSVDecision::Decision (class)">Decision</a></span>, <span class='object_link'><a href="CSVDecision/Error.html" title="CSVDecision::Error (class)">Error</a></span>, <span class='object_link'><a href="CSVDecision/FileError.html" title="CSVDecision::FileError (class)">FileError</a></span>, <span class='object_link'><a href="CSVDecision/Index.html" title="CSVDecision::Index (class)">Index</a></span>, <span class='object_link'><a href="CSVDecision/Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span>, <span class='object_link'><a href="CSVDecision/Paths.html" title="CSVDecision::Paths (class)">Paths</a></span>, <span class='object_link'><a href="CSVDecision/Result.html" title="CSVDecision::Result (class)">Result</a></span>, <span class='object_link'><a href="CSVDecision/Scan.html" title="CSVDecision::Scan (class)">Scan</a></span>, <span class='object_link'><a href="CSVDecision/ScanRow.html" title="CSVDecision::ScanRow (class)">ScanRow</a></span>, <span class='object_link'><a href="CSVDecision/Table.html" title="CSVDecision::Table (class)">Table</a></span>, <span class='object_link'><a href="CSVDecision/TableValidationError.html" title="CSVDecision::TableValidationError (class)">TableValidationError</a></span>
|
125
125
|
|
126
126
|
|
127
127
|
</p>
|
@@ -532,12 +532,12 @@ table.decide(topic: 'finance', region: 'Europe') #=> team_mem
|
|
532
532
|
<pre class="lines">
|
533
533
|
|
534
534
|
|
535
|
-
46
|
536
535
|
47
|
537
|
-
48
|
536
|
+
48
|
537
|
+
49</pre>
|
538
538
|
</td>
|
539
539
|
<td>
|
540
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/parse.rb', line
|
540
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/parse.rb', line 47</span>
|
541
541
|
|
542
542
|
<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='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
543
543
|
<span class='const'><span class='object_link'><a href="CSVDecision/Parse.html" title="CSVDecision::Parse (module)">Parse</a></span></span><span class='period'>.</span><span class='id identifier rubyid_table'><span class='object_link'><a href="CSVDecision/Parse.html#table-class_method" title="CSVDecision::Parse.table (method)">table</a></span></span><span class='lparen'>(</span><span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='const'><span class='object_link'><a href="CSVDecision/Options.html" title="CSVDecision::Options (module)">Options</a></span></span><span class='period'>.</span><span class='id identifier rubyid_normalize'><span class='object_link'><a href="CSVDecision/Options.html#normalize-class_method" title="CSVDecision::Options.normalize (method)">normalize</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
@@ -611,7 +611,7 @@ table.decide(topic: 'finance', region: 'Europe') #=> team_mem
|
|
611
611
|
</div>
|
612
612
|
|
613
613
|
<div id="footer">
|
614
|
-
Generated on Sun
|
614
|
+
Generated on Sun Feb 11 10:26:07 2018 by
|
615
615
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
616
616
|
0.9.12 (ruby-2.4.0).
|
617
617
|
</div>
|
@@ -133,7 +133,7 @@
|
|
133
133
|
</div>
|
134
134
|
|
135
135
|
<div id="footer">
|
136
|
-
Generated on Sun
|
136
|
+
Generated on Sun Feb 11 10:26:07 2018 by
|
137
137
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
138
138
|
0.9.12 (ruby-2.4.0).
|
139
139
|
</div>
|
@@ -405,6 +405,30 @@
|
|
405
405
|
<p>Output columns hash keyed by column index.</p>
|
406
406
|
</div></span>
|
407
407
|
|
408
|
+
</li>
|
409
|
+
|
410
|
+
|
411
|
+
<li class="public ">
|
412
|
+
<span class="summary_signature">
|
413
|
+
|
414
|
+
<a href="#paths-instance_method" title="#paths (instance method)">#<strong>paths</strong> ⇒ Hash{Index=>Entry} </a>
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
</span>
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
<span class="private note title">private</span>
|
426
|
+
|
427
|
+
|
428
|
+
<span class="summary_desc"><div class='inline'>
|
429
|
+
<p>path: columns hash keyed by column index.</p>
|
430
|
+
</div></span>
|
431
|
+
|
408
432
|
</li>
|
409
433
|
|
410
434
|
|
@@ -477,22 +501,22 @@
|
|
477
501
|
<pre class="lines">
|
478
502
|
|
479
503
|
|
480
|
-
167
|
481
|
-
168
|
482
|
-
169
|
483
|
-
170
|
484
|
-
171
|
485
|
-
172
|
486
|
-
173
|
487
|
-
174
|
488
|
-
175
|
489
|
-
176
|
490
|
-
177
|
491
504
|
178
|
492
|
-
179
|
505
|
+
179
|
506
|
+
180
|
507
|
+
181
|
508
|
+
182
|
509
|
+
183
|
510
|
+
184
|
511
|
+
185
|
512
|
+
186
|
513
|
+
187
|
514
|
+
188
|
515
|
+
189
|
516
|
+
190</pre>
|
493
517
|
</td>
|
494
518
|
<td>
|
495
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line
|
519
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 178</span>
|
496
520
|
|
497
521
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='rparen'>)</span>
|
498
522
|
<span class='comment'># If a column does not have a valid header cell, then it's empty of data.
|
@@ -802,12 +826,12 @@
|
|
802
826
|
<pre class="lines">
|
803
827
|
|
804
828
|
|
805
|
-
|
806
|
-
|
807
|
-
|
829
|
+
133
|
830
|
+
134
|
831
|
+
135</pre>
|
808
832
|
</td>
|
809
833
|
<td>
|
810
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line
|
834
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 133</span>
|
811
835
|
|
812
836
|
<span class='kw'>def</span> <span class='id identifier rubyid_defaults'>defaults</span>
|
813
837
|
<span class='ivar'>@dictionary</span><span class='op'>&.</span><span class='id identifier rubyid_defaults'>defaults</span>
|
@@ -847,12 +871,12 @@
|
|
847
871
|
<pre class="lines">
|
848
872
|
|
849
873
|
|
850
|
-
|
851
|
-
|
852
|
-
|
874
|
+
138
|
875
|
+
139
|
876
|
+
140</pre>
|
853
877
|
</td>
|
854
878
|
<td>
|
855
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line
|
879
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 138</span>
|
856
880
|
|
857
881
|
<span class='kw'>def</span> <span class='id identifier rubyid_defaults='>defaults=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
858
882
|
<span class='ivar'>@dictionary</span><span class='period'>.</span><span class='id identifier rubyid_defaults'>defaults</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
@@ -910,12 +934,12 @@
|
|
910
934
|
<pre class="lines">
|
911
935
|
|
912
936
|
|
913
|
-
|
914
|
-
|
915
|
-
|
937
|
+
144
|
938
|
+
145
|
939
|
+
146</pre>
|
916
940
|
</td>
|
917
941
|
<td>
|
918
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line
|
942
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 144</span>
|
919
943
|
|
920
944
|
<span class='kw'>def</span> <span class='id identifier rubyid_dictionary'>dictionary</span>
|
921
945
|
<span class='ivar'>@dictionary</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span>
|
@@ -968,12 +992,12 @@
|
|
968
992
|
<pre class="lines">
|
969
993
|
|
970
994
|
|
971
|
-
|
972
|
-
|
973
|
-
|
995
|
+
162
|
996
|
+
163
|
997
|
+
164</pre>
|
974
998
|
</td>
|
975
999
|
<td>
|
976
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line
|
1000
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 162</span>
|
977
1001
|
|
978
1002
|
<span class='kw'>def</span> <span class='id identifier rubyid_ifs'>ifs</span>
|
979
1003
|
<span class='ivar'>@dictionary</span><span class='period'>.</span><span class='id identifier rubyid_ifs'>ifs</span>
|
@@ -1031,12 +1055,12 @@
|
|
1031
1055
|
<pre class="lines">
|
1032
1056
|
|
1033
1057
|
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1058
|
+
173
|
1059
|
+
174
|
1060
|
+
175</pre>
|
1037
1061
|
</td>
|
1038
1062
|
<td>
|
1039
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line
|
1063
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 173</span>
|
1040
1064
|
|
1041
1065
|
<span class='kw'>def</span> <span class='id identifier rubyid_input_keys'>input_keys</span>
|
1042
1066
|
<span class='ivar'>@dictionary</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid__k'>_k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span> <span class='op'>==</span> <span class='symbol'>:in</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
@@ -1089,12 +1113,12 @@
|
|
1089
1113
|
<pre class="lines">
|
1090
1114
|
|
1091
1115
|
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1116
|
+
150
|
1117
|
+
151
|
1118
|
+
152</pre>
|
1095
1119
|
</td>
|
1096
1120
|
<td>
|
1097
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line
|
1121
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 150</span>
|
1098
1122
|
|
1099
1123
|
<span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span>
|
1100
1124
|
<span class='ivar'>@dictionary</span><span class='period'>.</span><span class='id identifier rubyid_ins'>ins</span>
|
@@ -1147,12 +1171,12 @@
|
|
1147
1171
|
<pre class="lines">
|
1148
1172
|
|
1149
1173
|
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1174
|
+
156
|
1175
|
+
157
|
1176
|
+
158</pre>
|
1153
1177
|
</td>
|
1154
1178
|
<td>
|
1155
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line
|
1179
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 156</span>
|
1156
1180
|
|
1157
1181
|
<span class='kw'>def</span> <span class='id identifier rubyid_outs'>outs</span>
|
1158
1182
|
<span class='ivar'>@dictionary</span><span class='op'>&.</span><span class='id identifier rubyid_outs'>outs</span>
|
@@ -1160,6 +1184,64 @@
|
|
1160
1184
|
</td>
|
1161
1185
|
</tr>
|
1162
1186
|
</table>
|
1187
|
+
</div>
|
1188
|
+
|
1189
|
+
<div class="method_details ">
|
1190
|
+
<h3 class="signature " id="paths-instance_method">
|
1191
|
+
|
1192
|
+
#<strong>paths</strong> ⇒ <tt>Hash{<span class='object_link'><a href="Index.html" title="CSVDecision::Index (class)">Index</a></span>=>Entry}</tt>
|
1193
|
+
|
1194
|
+
|
1195
|
+
|
1196
|
+
|
1197
|
+
|
1198
|
+
</h3><div class="docstring">
|
1199
|
+
<div class="discussion">
|
1200
|
+
<p class="note private">
|
1201
|
+
<strong>This method is part of a private API.</strong>
|
1202
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
1203
|
+
</p>
|
1204
|
+
|
1205
|
+
<p>path: columns hash keyed by column index.</p>
|
1206
|
+
|
1207
|
+
|
1208
|
+
</div>
|
1209
|
+
</div>
|
1210
|
+
<div class="tags">
|
1211
|
+
|
1212
|
+
<p class="tag_title">Returns:</p>
|
1213
|
+
<ul class="return">
|
1214
|
+
|
1215
|
+
<li>
|
1216
|
+
|
1217
|
+
|
1218
|
+
<span class='type'>(<tt>Hash{<span class='object_link'><a href="Index.html" title="CSVDecision::Index (class)">Index</a></span>=>Entry}</tt>)</span>
|
1219
|
+
|
1220
|
+
|
1221
|
+
|
1222
|
+
</li>
|
1223
|
+
|
1224
|
+
</ul>
|
1225
|
+
|
1226
|
+
</div><table class="source_code">
|
1227
|
+
<tr>
|
1228
|
+
<td>
|
1229
|
+
<pre class="lines">
|
1230
|
+
|
1231
|
+
|
1232
|
+
168
|
1233
|
+
169
|
1234
|
+
170</pre>
|
1235
|
+
</td>
|
1236
|
+
<td>
|
1237
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 168</span>
|
1238
|
+
|
1239
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_paths'>paths</span>
|
1240
|
+
<span class='ivar'>@dictionary</span><span class='period'>.</span><span class='id identifier rubyid_paths'>paths</span>
|
1241
|
+
<span class='kw'>end</span></pre>
|
1242
|
+
</td>
|
1243
|
+
</tr>
|
1244
|
+
</table>
|
1163
1245
|
</div>
|
1164
1246
|
|
1165
1247
|
</div>
|
@@ -1167,7 +1249,7 @@
|
|
1167
1249
|
</div>
|
1168
1250
|
|
1169
1251
|
<div id="footer">
|
1170
|
-
Generated on Sun
|
1252
|
+
Generated on Sun Feb 11 10:26:08 2018 by
|
1171
1253
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1172
1254
|
0.9.12 (ruby-2.4.0).
|
1173
1255
|
</div>
|
@@ -257,6 +257,33 @@ overlap with input column symbols.</p>
|
|
257
257
|
<p>All output column dictionary entries.</p>
|
258
258
|
</div></span>
|
259
259
|
|
260
|
+
</li>
|
261
|
+
|
262
|
+
|
263
|
+
<li class="public ">
|
264
|
+
<span class="summary_signature">
|
265
|
+
|
266
|
+
<a href="#paths-instance_method" title="#paths (instance method)">#<strong>paths</strong> ⇒ Hash{Integer=>Symbol} </a>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
</span>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
<span class="private note title">private</span>
|
281
|
+
|
282
|
+
|
283
|
+
<span class="summary_desc"><div class='inline'>
|
284
|
+
<p>All path columns.</p>
|
285
|
+
</div></span>
|
286
|
+
|
260
287
|
</li>
|
261
288
|
|
262
289
|
|
@@ -335,16 +362,17 @@ overlap with input column symbols.</p>
|
|
335
362
|
<pre class="lines">
|
336
363
|
|
337
364
|
|
338
|
-
118
|
339
|
-
119
|
340
|
-
120
|
341
|
-
121
|
342
365
|
122
|
343
366
|
123
|
344
|
-
124
|
367
|
+
124
|
368
|
+
125
|
369
|
+
126
|
370
|
+
127
|
371
|
+
128
|
372
|
+
129</pre>
|
345
373
|
</td>
|
346
374
|
<td>
|
347
|
-
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line
|
375
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 122</span>
|
348
376
|
|
349
377
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
350
378
|
<span class='ivar'>@columns</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -352,6 +380,7 @@ overlap with input column symbols.</p>
|
|
352
380
|
<span class='ivar'>@ifs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
353
381
|
<span class='ivar'>@ins</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
354
382
|
<span class='ivar'>@outs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
383
|
+
<span class='ivar'>@paths</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
355
384
|
<span class='kw'>end</span></pre>
|
356
385
|
</td>
|
357
386
|
</tr>
|
@@ -691,13 +720,78 @@ of :outs.</p>
|
|
691
720
|
</table>
|
692
721
|
</div>
|
693
722
|
|
723
|
+
|
724
|
+
<span id="paths=-instance_method"></span>
|
725
|
+
<div class="method_details ">
|
726
|
+
<h3 class="signature " id="paths-instance_method">
|
727
|
+
|
728
|
+
#<strong>paths</strong> ⇒ <tt>Hash{Integer=>Symbol}</tt>
|
729
|
+
|
730
|
+
|
731
|
+
|
732
|
+
|
733
|
+
|
734
|
+
</h3><div class="docstring">
|
735
|
+
<div class="discussion">
|
736
|
+
<p class="note private">
|
737
|
+
<strong>This method is part of a private API.</strong>
|
738
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
739
|
+
</p>
|
740
|
+
|
741
|
+
<p>Returns All path columns. This is actually just a subset of :outs.</p>
|
742
|
+
|
743
|
+
|
744
|
+
</div>
|
745
|
+
</div>
|
746
|
+
<div class="tags">
|
747
|
+
|
748
|
+
<p class="tag_title">Returns:</p>
|
749
|
+
<ul class="return">
|
750
|
+
|
751
|
+
<li>
|
752
|
+
|
753
|
+
|
754
|
+
<span class='type'>(<tt>Hash{Integer=>Symbol}</tt>)</span>
|
755
|
+
|
756
|
+
|
757
|
+
|
758
|
+
—
|
759
|
+
<div class='inline'>
|
760
|
+
<p>All path columns. This is actually just a subset of :outs.</p>
|
761
|
+
</div>
|
762
|
+
|
763
|
+
</li>
|
764
|
+
|
765
|
+
</ul>
|
766
|
+
|
767
|
+
</div><table class="source_code">
|
768
|
+
<tr>
|
769
|
+
<td>
|
770
|
+
<pre class="lines">
|
771
|
+
|
772
|
+
|
773
|
+
120
|
774
|
+
121
|
775
|
+
122</pre>
|
776
|
+
</td>
|
777
|
+
<td>
|
778
|
+
<pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 120</span>
|
779
|
+
|
780
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_paths'>paths</span>
|
781
|
+
<span class='ivar'>@paths</span>
|
782
|
+
<span class='kw'>end</span></pre>
|
783
|
+
</td>
|
784
|
+
</tr>
|
785
|
+
</table>
|
786
|
+
</div>
|
787
|
+
|
694
788
|
</div>
|
695
789
|
|
696
790
|
|
697
791
|
</div>
|
698
792
|
|
699
793
|
<div id="footer">
|
700
|
-
Generated on Sun
|
794
|
+
Generated on Sun Feb 11 10:26:08 2018 by
|
701
795
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
702
796
|
0.9.12 (ruby-2.4.0).
|
703
797
|
</div>
|