Class: Squeel::Nodes::Unary
- Includes:
- PredicateOperators
- Defined in:
- lib/squeel/nodes/unary.rb
Overview
A node that contains a single expression.
Instance Attribute Summary collapse
-
#expr ⇒ Object
readonly
The expression contained in the node.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
Object comparison.
- #hash ⇒ Object
-
#initialize(expr) ⇒ Unary
constructor
Create a new Unary node.
Methods included from PredicateOperators
Constructor Details
#initialize(expr) ⇒ Unary
Create a new Unary node.
13 14 15 |
# File 'lib/squeel/nodes/unary.rb', line 13 def initialize(expr) @expr = expr end |
Instance Attribute Details
#expr ⇒ Object (readonly)
Returns The expression contained in the node.
9 10 11 |
# File 'lib/squeel/nodes/unary.rb', line 9 def expr @expr end |
Instance Method Details
#eql?(other) ⇒ Boolean
Object comparison
22 23 24 25 |
# File 'lib/squeel/nodes/unary.rb', line 22 def eql?(other) self.class.eql?(other.class) && self.expr.eql?(other.expr) end |
#hash ⇒ Object
17 18 19 |
# File 'lib/squeel/nodes/unary.rb', line 17 def hash @expr.hash end |