Class: De::Boolean::BooleanOperator
- Inherits:
-
Operator
- Object
- Tree::TreeNode
- Expression
- Operator
- De::Boolean::BooleanOperator
- Includes:
- Bn, SymmetricOperator
- Defined in:
- lib/de/boolean/operator.rb
Overview
Class representing Boolean operator Base abstract class for concrete operators AND, OR, NOT
Instance Attribute Summary
Attributes inherited from Tree::TreeNode
Instance Method Summary collapse
-
#<<(obj) ⇒ Object
Adds boolean operator or operand as a child to boolean operator.
-
#initialize(name, content, operands = nil) ⇒ BooleanOperator
constructor
Constructor.
Methods included from SymmetricOperator
Methods inherited from Operator
Methods inherited from Expression
#copy, #eql?, #evaluate, #hash, #to_s, #valid?
Constructor Details
#initialize(name, content, operands = nil) ⇒ BooleanOperator
Constructor. Prevents direct BooleanOperator class objects creation
Input
name<String>
- operands<Array>
-
(optional) array of Operand objects.
If given they are added as children to current operator
39 40 41 42 |
# File 'lib/de/boolean/operator.rb', line 39 def initialize(name, content, operands = nil) raise Error::AbstractClassObjectCreationError if instance_of? BooleanOperator super(name, content, operands) end |