Class: CSVDecision::Columns
- Inherits:
-
Object
- Object
- CSVDecision::Columns
- Defined in:
- lib/csv_decision/columns.rb
Overview
Dictionary of all this table’s columns - inputs, outputs etc.
Defined Under Namespace
Classes: Dictionary, Entry
Instance Attribute Summary collapse
-
#dictionary ⇒ Object
readonly
Dictionary of all data columns.
Instance Method Summary collapse
-
#initialize(table) ⇒ Columns
constructor
A new instance of Columns.
-
#ins ⇒ Object
Input columns.
-
#outs ⇒ Object
Output columns.
Constructor Details
#initialize(table) ⇒ Columns
Returns a new instance of Columns.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/csv_decision/columns.rb', line 65 def initialize(table) # If a column does not have a valid header cell, then it's empty of data. # Return the stripped header row, and remove it from the data array. row = Header.strip_empty_columns(rows: table.rows) # Build a dictionary of all valid data columns from the header row. @dictionary = Header.dictionary(row: row) if row freeze end |
Instance Attribute Details
#dictionary ⇒ Object (readonly)
Dictionary of all data columns
42 43 44 |
# File 'lib/csv_decision/columns.rb', line 42 def dictionary @dictionary end |
Instance Method Details
#ins ⇒ Object
Input columns
45 46 47 |
# File 'lib/csv_decision/columns.rb', line 45 def ins @dictionary.ins end |
#outs ⇒ Object
Output columns
50 51 52 |
# File 'lib/csv_decision/columns.rb', line 50 def outs @dictionary.outs end |