Class: Chicago::ETL::Sink Abstract
- Inherits:
-
PipelineEndpoint
- Object
- PipelineEndpoint
- Chicago::ETL::Sink
- Defined in:
- lib/chicago/etl/sink.rb
Overview
The destination for rows passing through a pipeline stage.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from PipelineEndpoint
Instance Method Summary collapse
-
#<<(row) ⇒ Object
Writes a row to this sink.
-
#close ⇒ Object
Performs any operations after writing rows to this sink.
-
#constant_values ⇒ Object
Specifies a hash of values that are assumed to apply to all rows.
-
#open ⇒ Object
Performs any operations before writing rows to this sink.
-
#set_constant_values(hash = {}) ⇒ Object
Sets a number of constant values.
-
#truncate ⇒ Object
Removes all rows from this sink.
Methods inherited from PipelineEndpoint
Instance Method Details
#<<(row) ⇒ Object
Writes a row to this sink.
By default does nothing; may be overridden by subclasses.
40 41 |
# File 'lib/chicago/etl/sink.rb', line 40 def <<(row) end |
#close ⇒ Object
Performs any operations after writing rows to this sink.
By default does nothing; may be overridden by subclasses.
34 35 |
# File 'lib/chicago/etl/sink.rb', line 34 def close end |
#constant_values ⇒ Object
Specifies a hash of values that are assumed to apply to all rows.
Subclasses should use there constant values appropriately when writing rows, by merging them with the row or otherwise ensuring that they end up in the final source this sink represents.
15 16 17 |
# File 'lib/chicago/etl/sink.rb', line 15 def constant_values @constant_values ||= {} end |
#open ⇒ Object
Performs any operations before writing rows to this sink.
By default does nothing; may be overridden by subclasses.
28 29 |
# File 'lib/chicago/etl/sink.rb', line 28 def open end |
#set_constant_values(hash = {}) ⇒ Object
Sets a number of constant values.
20 21 22 23 |
# File 'lib/chicago/etl/sink.rb', line 20 def set_constant_values(hash={}) constant_values.merge!(hash) self end |
#truncate ⇒ Object
Removes all rows from this sink.
This includes all rows written prior to this particular execution of a pipeline stage.
By default does nothing; should be overritten by subclasses.
49 50 |
# File 'lib/chicago/etl/sink.rb', line 49 def truncate end |