Class: Squeel::Nodes::Binary
- Inherits:
-
Object
- Object
- Squeel::Nodes::Binary
- Includes:
- PredicateOperators
- Defined in:
- lib/squeel/nodes/binary.rb
Overview
A node that represents an operation with two operands.
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
The left operand.
-
#right ⇒ Object
readonly
The right operand.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
(also: #==)
Comparison with other nodes.
-
#initialize(left, right) ⇒ Binary
constructor
A new instance of Binary.
Methods included from PredicateOperators
Constructor Details
#initialize(left, right) ⇒ Binary
Returns a new instance of Binary.
18 19 20 |
# File 'lib/squeel/nodes/binary.rb', line 18 def initialize(left, right) @left, @right = left, right end |
Instance Attribute Details
#left ⇒ Object (readonly)
The left operand
11 12 13 |
# File 'lib/squeel/nodes/binary.rb', line 11 def left @left end |
#right ⇒ Object (readonly)
The right operand
14 15 16 |
# File 'lib/squeel/nodes/binary.rb', line 14 def right @right end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
Comparison with other nodes
23 24 25 26 27 |
# File 'lib/squeel/nodes/binary.rb', line 23 def eql?(other) self.class == other.class && self.left == other.left && self.right == other.right end |