Class: Chicago::Flow::Sink

Inherits:
PipelineEndpoint show all
Defined in:
lib/chicago/flow/sink.rb

Direct Known Subclasses

ArraySink, MysqlFileSink

Instance Attribute Summary

Attributes inherited from PipelineEndpoint

#fields

Instance Method Summary collapse

Methods inherited from PipelineEndpoint

#has_defined_fields?

Instance Method Details

#<<(row) ⇒ Object

Writes a row to this sink.

By default does nothing; may be overridden by subclasses.



30
31
# File 'lib/chicago/flow/sink.rb', line 30

def <<(row)
end

#closeObject

Performs any operations after writing rows to this sink.

By default does nothing; may be overridden by subclasses.



24
25
# File 'lib/chicago/flow/sink.rb', line 24

def close
end

#constant_valuesObject

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.



11
12
13
# File 'lib/chicago/flow/sink.rb', line 11

def constant_values
  @constant_values ||= {}
end

#openObject

Performs any operations before writing rows to this sink.

By default does nothing; may be overridden by subclasses.



18
19
# File 'lib/chicago/flow/sink.rb', line 18

def open
end