Class: ArcFurnace::Source

Inherits:
Node
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/arc-furnace/source.rb

Instance Attribute Summary

Attributes inherited from Node

#error_handler, #node_id, #params

Instance Method Summary collapse

Instance Method Details

#advanceObject

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

#closeObject

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?

Returns:

  • (Boolean)


26
27
28
# File 'lib/arc-furnace/source.rb', line 26

def empty?
  raise 'Unimplemented'
end

#finalizeObject

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

#prepareObject

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

#rowObject

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

#valueObject

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