Class: Locomotive::RelationalAlgebra::Not
- Inherits:
-
Unary
- Object
- RelAlgAstNode
- Operator
- Unary
- Locomotive::RelationalAlgebra::Not
- Defined in:
- lib/locomotive/relational_algebra/operators/boolean/not.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
Returns the value of attribute item.
-
#res ⇒ Object
Returns the value of attribute res.
Attributes inherited from Operator
Attributes included from AstHelpers::AstNode
#kind, #left_child, #owner, #right_child, #value
Instance Method Summary collapse
- #child=(op) ⇒ Object
- #clone ⇒ Object
-
#initialize(op, res, item) ⇒ Not
constructor
A new instance of Not.
- #set(var, plan) ⇒ Object
- #xml_content ⇒ Object
- #xml_kind ⇒ Object
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(op, res, item) ⇒ Not
Returns a new instance of Not.
10 11 12 13 14 |
# File 'lib/locomotive/relational_algebra/operators/boolean/not.rb', line 10 def initialize(op, res, item) self.res, self.item = res, item super(op) 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/boolean/not.rb', line 6 def item @item end |
#res ⇒ Object
Returns the value of attribute res.
6 7 8 |
# File 'lib/locomotive/relational_algebra/operators/boolean/not.rb', line 6 def res @res end |
Instance Method Details
#child=(op) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/locomotive/relational_algebra/operators/boolean/not.rb', line 16 def child=(op) unless op.schema.attributes?([item]) raise CorruptedSchema, "Schema #{op.schema.attributes} does not " \ "contain all attributes of #{item1}." end self.schema = op.schema + Schema.new({ res => [RBool.instance] }) super(op) end |
#clone ⇒ Object
40 41 42 43 44 |
# File 'lib/locomotive/relational_algebra/operators/boolean/not.rb', line 40 def clone Not.new(child.clone, res.clone, item.clone) end |
#set(var, plan) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/locomotive/relational_algebra/operators/boolean/not.rb', line 46 def set(var, plan) self.class.new( child.set(var,plan), res.clone, item.clone) end |
#xml_content ⇒ Object
29 30 31 32 33 34 |
# File 'lib/locomotive/relational_algebra/operators/boolean/not.rb', line 29 def xml_content content do [column(:name => res.to_xml, :new => true), column(:name => item.to_xml, :new => false)].join end end |
#xml_kind ⇒ Object
36 37 38 |
# File 'lib/locomotive/relational_algebra/operators/boolean/not.rb', line 36 def xml_kind self.class.to_s.split('::').last.downcase.to_sym end |