Class: Locomotive::RelationalAlgebra::Error
- Inherits:
-
Binary
- Object
- RelAlgAstNode
- Operator
- Binary
- Locomotive::RelationalAlgebra::Error
- Defined in:
- lib/locomotive/relational_algebra/operators/error/error.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
Returns the value of attribute item.
Attributes inherited from Operator
Attributes included from AstHelpers::AstNode
#kind, #left_child, #owner, #right_child, #value
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(op1, op2, item) ⇒ Error
constructor
A new instance of Error.
- #left_and_right=(op1, op2) ⇒ Object
- #set(var, plan) ⇒ Object
- #xml_content ⇒ Object
- #xml_kind ⇒ Object
Methods inherited from Binary
Methods inherited from Operator
#bound, #free, #to_xml, #xml_schema
Methods included from XML
Methods included from AstHelpers::Annotations
Methods included from AstHelpers::AstNode
#has_left_child?, #has_right_child?, #is_leaf?, #traverse, #traverse_strategy=
Constructor Details
#initialize(op1, op2, item) ⇒ Error
Returns a new instance of Error.
9 10 11 12 |
# File 'lib/locomotive/relational_algebra/operators/error/error.rb', line 9 def initialize(op1, op2, item) self.item = item super(op1, op2) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Locomotive::AstHelpers::Annotations
Instance Attribute Details
#item ⇒ Object
Returns the value of attribute item.
6 7 8 |
# File 'lib/locomotive/relational_algebra/operators/error/error.rb', line 6 def item @item end |
Instance Method Details
#clone ⇒ Object
35 36 37 38 39 |
# File 'lib/locomotive/relational_algebra/operators/error/error.rb', line 35 def clone Error.new( left.clone, right.clone, item.clone) end |
#left_and_right=(op1, op2) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/locomotive/relational_algebra/operators/error/error.rb', line 14 def left_and_right=(op1, op2) unless op.schema.attributes?([item]) raise CorruptedSchema, "Schema #{op.schema.attributes} does not " \ "contain all attributes of #{item}." end # set the schema to its right child self.schema = op2.schema end |
#set(var, plan) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/locomotive/relational_algebra/operators/error/error.rb', line 41 def set(var, plan) Error.new( left.set(var,plan), right.set(var.plan), item.clone) end |
#xml_content ⇒ Object
29 30 31 32 33 |
# File 'lib/locomotive/relational_algebra/operators/error/error.rb', line 29 def xml_content content do column :name => item.to_xml, :new => false end end |
#xml_kind ⇒ Object
25 26 27 |
# File 'lib/locomotive/relational_algebra/operators/error/error.rb', line 25 def xml_kind :error end |