Class: Itiel::Transform::ConstantColumn
- Inherits:
-
Object
- Object
- Itiel::Transform::ConstantColumn
- Includes:
- Nameable, ChainedStep
- Defined in:
- lib/itiel/transform/constant_column.rb
Overview
The resulting stream will have a column named “column” with the value “Constant Value” for all rows.
Instance Attribute Summary collapse
-
#append ⇒ Object
Returns the value of attribute append.
Attributes included from Nameable
Attributes included from ChainedStep
Instance Method Summary collapse
-
#initialize(*args) ⇒ ConstantColumn
constructor
A new instance of ConstantColumn.
- #transform!(input_stream) ⇒ Object
Methods included from ChainedStep
Constructor Details
#initialize(*args) ⇒ ConstantColumn
Returns a new instance of ConstantColumn.
24 25 26 |
# File 'lib/itiel/transform/constant_column.rb', line 24 def initialize(*args) self.append = args.first end |
Instance Attribute Details
#append ⇒ Object
Returns the value of attribute append.
22 23 24 |
# File 'lib/itiel/transform/constant_column.rb', line 22 def append @append end |
Instance Method Details
#transform!(input_stream) ⇒ Object
28 29 30 31 32 |
# File 'lib/itiel/transform/constant_column.rb', line 28 def transform!(input_stream) input_stream.collect do |row| row.merge(self.append) end end |