Class: ArcFurnace::AbstractJoin

Inherits:
Source show all
Defined in:
lib/arc-furnace/abstract_join.rb

Direct Known Subclasses

InnerJoin, OuterJoin

Instance Attribute Summary

Attributes inherited from Node

#error_handler, #node_id, #params

Instance Method Summary collapse

Methods inherited from Source

#close, #empty?, #finalize, #prepare, #row

Constructor Details

#initialize(source:, hash:, key_column: nil) ⇒ AbstractJoin

The source is a source, the hash is a hash, and one can optionally pass the key column to get the primary key for each source entity, the default is equijoin semantics–the key of the hash is used.



10
11
12
13
14
15
16
17
18
# File 'lib/arc-furnace/abstract_join.rb', line 10

def initialize(source: , hash:, key_column: nil)
  if source.is_a?(::ArcFurnace::Source) && hash.is_a?(::ArcFurnace::Hash)
    @hash = hash
    @source = source
    @key_column = key_column || hash.key_column
  else
    raise 'Must be passed one Hash and one Source!'
  end
end

Instance Method Details

#advanceObject



27
28
29
# File 'lib/arc-furnace/abstract_join.rb', line 27

def advance
  raise "Unimplemented!"
end

#valueObject



20
21
22
23
24
25
# File 'lib/arc-furnace/abstract_join.rb', line 20

def value
  if @value.nil? && !empty?
    advance
  end
  @value
end