Class: Arel::Nodes::Exists
- Inherits:
-
Unary
- Object
- Unary
- Arel::Nodes::Exists
- Includes:
- OrderPredications, Predications, WindowPredications
- Defined in:
- lib/arel/extensions/exists.rb
Overview
Instance Attribute Summary collapse
-
#alias ⇒ Object
Returns the value of attribute alias.
-
#distinct ⇒ Object
Returns the value of attribute distinct.
-
#expressions ⇒ Object
Returns the value of attribute expressions.
Instance Method Summary collapse
- #as(aliaz) ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(expr, aliaz = nil) ⇒ Exists
constructor
A new instance of Exists.
Constructor Details
#initialize(expr, aliaz = nil) ⇒ Exists
Returns a new instance of Exists.
23 24 25 26 27 |
# File 'lib/arel/extensions/exists.rb', line 23 def initialize(expr, aliaz = nil) @expressions = expr @alias = aliaz && SqlLiteral.new(aliaz) @distinct = false end |
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
21 22 23 |
# File 'lib/arel/extensions/exists.rb', line 21 def alias @alias end |
#distinct ⇒ Object
Returns the value of attribute distinct.
21 22 23 |
# File 'lib/arel/extensions/exists.rb', line 21 def distinct @distinct end |
#expressions ⇒ Object
Returns the value of attribute expressions.
21 22 23 |
# File 'lib/arel/extensions/exists.rb', line 21 def expressions @expressions end |
Instance Method Details
#as(aliaz) ⇒ Object
29 30 31 32 |
# File 'lib/arel/extensions/exists.rb', line 29 def as(aliaz) self.alias = SqlLiteral.new(aliaz) self end |
#eql?(other) ⇒ Boolean Also known as: ==
38 39 40 41 42 43 |
# File 'lib/arel/extensions/exists.rb', line 38 def eql?(other) self.class == other.class && expressions == other.expressions && self.alias == other.alias && distinct == other.distinct end |
#hash ⇒ Object
34 35 36 |
# File 'lib/arel/extensions/exists.rb', line 34 def hash [@expressions, @alias, @distinct].hash end |