Class: Locomotive::RelationalAlgebra::Cross

Inherits:
Join show all
Defined in:
lib/locomotive/relational_algebra/operators/join/cross.rb

Instance Attribute Summary

Attributes inherited from Operator

#schema

Attributes included from AstHelpers::AstNode

#kind, #left_child, #owner, #right_child, #value

Instance Method Summary collapse

Methods inherited from Operator

#bound, #free, #to_xml, #xml_content, #xml_kind, #xml_schema

Methods included from XML

included, #quote, #to_xml

Methods included from AstHelpers::Annotations

#method_missing, #respond_to?

Methods included from AstHelpers::AstNode

#has_left_child?, #has_right_child?, #is_leaf?, #traverse, #traverse_strategy=

Constructor Details

#initialize(op1, op2) ⇒ Cross

Returns a new instance of Cross.



6
7
8
# File 'lib/locomotive/relational_algebra/operators/join/cross.rb', line 6

def initialize(op1,op2)
  super(op1,op2)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Locomotive::AstHelpers::Annotations

Instance Method Details

#cloneObject



15
16
17
# File 'lib/locomotive/relational_algebra/operators/join/cross.rb', line 15

def clone
  Cross.new(left.clone,right.clone)
end

#left_and_right(op1, op2) ⇒ Object



10
11
12
13
# File 'lib/locomotive/relational_algebra/operators/join/cross.rb', line 10

def left_and_right(op1,op2)
  self.schema = op1.schema + op2.schema
  super(op1,op2)
end

#set(var, plan) ⇒ Object



19
20
21
22
23
# File 'lib/locomotive/relational_algebra/operators/join/cross.rb', line 19

def set(var,plan)
  Cross.new(
    left.set(var,plan),
    right.set(var,plan))
end