Class: Chicago::Flow::ArraySink
- Inherits:
-
Sink
- Object
- PipelineEndpoint
- Sink
- Chicago::Flow::ArraySink
- Defined in:
- lib/chicago/flow/array_sink.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes inherited from PipelineEndpoint
Instance Method Summary collapse
- #<<(row) ⇒ Object
-
#initialize(fields = []) ⇒ ArraySink
constructor
A new instance of ArraySink.
Methods inherited from Sink
#close, #constant_values, #open
Methods inherited from PipelineEndpoint
Constructor Details
#initialize(fields = []) ⇒ ArraySink
Returns a new instance of ArraySink.
6 7 8 9 |
# File 'lib/chicago/flow/array_sink.rb', line 6 def initialize(fields=[]) @fields = [fields].flatten @data = [] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/chicago/flow/array_sink.rb', line 4 def data @data end |
Instance Method Details
#<<(row) ⇒ Object
11 12 13 |
# File 'lib/chicago/flow/array_sink.rb', line 11 def <<(row) @data << row.merge(constant_values) end |