Class: Locomotive::RelationalAlgebra::Binary

Inherits:
Operator show all
Defined in:
lib/locomotive/relational_algebra/operators/basic_operators.rb

Overview

A binary operator has exactly two children

Direct Known Subclasses

Error, Join, RelLambda, Serialize, Set

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) ⇒ Binary

Returns a new instance of Binary.

Raises:



134
135
136
137
138
139
# File 'lib/locomotive/relational_algebra/operators/basic_operators.rb', line 134

def initialize(op1, op2)
  raise AbstractClassError,
        "#{self.class} is an abstract class" if self.class == Binary
  super()
  left_and_right(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

#left_and_right(op1, op2) ⇒ Object

alias :left= :left_child= def_sig :left=, Operator alias :right= :right_child= def_sig :right=, Operator



129
130
131
132
# File 'lib/locomotive/relational_algebra/operators/basic_operators.rb', line 129

def left_and_right(op1, op2)
  self.left_child = op1
  self.right_child = op2 
end