Class: ArcFurnace::Source
- Extended by:
- Forwardable
- Defined in:
- lib/arc-furnace/source.rb
Direct Known Subclasses
AbstractJoin, EnumeratorSource, Filter, Merge, MultiCSVSource, MultiExcelSource, Observer, Transform, Unfold
Instance Attribute Summary
Attributes inherited from Node
#error_handler, #node_id, #params
Instance Method Summary collapse
-
#advance ⇒ Object
Advance this source by one.
-
#close ⇒ Object
Close the source.
-
#empty? ⇒ Boolean
Is this source empty?.
-
#finalize ⇒ Object
Called at the end of processing, do any clean-up or state-saving here.
-
#prepare ⇒ Object
Called to prepare anything this source needs to do before providing rows.
-
#row ⇒ Object
Advance this source by one, returning the row as a hash.
-
#value ⇒ Object
The current value this source points at This is generally the only method required to implement a source.
Instance Method Details
#advance ⇒ Object
Advance this source by one. #advance specifies no return value contract
42 43 44 |
# File 'lib/arc-furnace/source.rb', line 42 def advance raise 'Unimplemented' end |
#close ⇒ Object
Close the source. Called by the framework at the end of processing.
37 38 39 |
# File 'lib/arc-furnace/source.rb', line 37 def close end |
#empty? ⇒ Boolean
Is this source empty?
26 27 28 |
# File 'lib/arc-furnace/source.rb', line 26 def empty? raise 'Unimplemented' end |
#finalize ⇒ Object
Called at the end of processing, do any clean-up or state-saving here.
21 22 23 |
# File 'lib/arc-furnace/source.rb', line 21 def finalize end |
#prepare ⇒ Object
Called to prepare anything this source needs to do before providing rows. For instance, opening a source file or database connection.
9 10 11 |
# File 'lib/arc-furnace/source.rb', line 9 def prepare end |
#row ⇒ Object
Advance this source by one, returning the row as a hash
14 15 16 17 18 |
# File 'lib/arc-furnace/source.rb', line 14 def row result = value advance result end |
#value ⇒ Object
The current value this source points at This is generally the only method required to implement a source.
32 33 34 |
# File 'lib/arc-furnace/source.rb', line 32 def value raise 'Unimplemented' end |