Class: Portable::Modeling::Column
- Inherits:
-
Object
- Object
- Portable::Modeling::Column
- Defined in:
- lib/portable/modeling/column.rb
Overview
Defines all the options a column can contain. The most basic would to just include a header (defaults to ”). If no transformers are defined then a simple resolver using the header will be used. This works well for pass-through file writes. Use the transformers to further customize each data point being written.
Constant Summary collapse
- DEFAULT_TRANSFORMER_TYPE =
'r/value/resolve'
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#transformers ⇒ Object
readonly
Returns the value of attribute transformers.
Instance Method Summary collapse
-
#initialize(header: '', transformers: []) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(header: '', transformers: []) ⇒ Column
Returns a new instance of Column.
23 24 25 26 27 28 29 30 |
# File 'lib/portable/modeling/column.rb', line 23 def initialize(header: '', transformers: []) @header = header.to_s @transformers = Realize::Transformers.array(transformers) @transformers << default_transformer if @transformers.empty? freeze end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
21 22 23 |
# File 'lib/portable/modeling/column.rb', line 21 def header @header end |
#transformers ⇒ Object (readonly)
Returns the value of attribute transformers.
21 22 23 |
# File 'lib/portable/modeling/column.rb', line 21 def transformers @transformers end |