Class: Squeel::Nodes::Unary
- Inherits:
-
Object
- Object
- Squeel::Nodes::Unary
- Includes:
- PredicateOperators
- Defined in:
- lib/squeel/nodes/unary.rb
Overview
A node that contains a single expression.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#expr ⇒ Object
readonly
The expression contained in the node.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
(also: #==)
Object comparison.
-
#initialize(expr) ⇒ Unary
constructor
Create a new Unary node.
Methods included from PredicateOperators
Constructor Details
#initialize(expr) ⇒ Unary
Create a new Unary node.
15 16 17 |
# File 'lib/squeel/nodes/unary.rb', line 15 def initialize(expr) @expr = expr end |
Instance Attribute Details
#expr ⇒ Object (readonly)
Returns The expression contained in the node.
11 12 13 |
# File 'lib/squeel/nodes/unary.rb', line 11 def expr @expr end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
Object comparison
20 21 22 23 |
# File 'lib/squeel/nodes/unary.rb', line 20 def eql?(other) self.class == other.class && self.expr == other.expr end |