Class: Squeel::Nodes::SubqueryJoin
- Defined in:
- lib/squeel/nodes/subquery_join.rb
Instance Attribute Summary collapse
-
#constraints ⇒ Object
Returns the value of attribute constraints.
-
#subquery ⇒ Object
Returns the value of attribute subquery.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
(also: #==)
Compare with other objects.
-
#hash ⇒ Object
Implemented for equality testing.
-
#initialize(subquery, constraints, type = Squeel::InnerJoin) ⇒ SubqueryJoin
constructor
A new instance of SubqueryJoin.
- #inner ⇒ Object
- #outer ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(subquery, constraints, type = Squeel::InnerJoin) ⇒ SubqueryJoin
Returns a new instance of SubqueryJoin.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/squeel/nodes/subquery_join.rb', line 6 def initialize(subquery, constraints, type = Squeel::InnerJoin) raise ArgumentError, "subquery(#{subquery}) isn't an Squeel::Nodes::As" unless subquery.is_a?(As) raise ArgumentError, "constraints(#{constraints}) isn't a Squeel::Nodes::Node" unless constraints.is_a?(Node) self.subquery = subquery self.constraints = constraints self.type = type end |
Instance Attribute Details
#constraints ⇒ Object
Returns the value of attribute constraints.
4 5 6 |
# File 'lib/squeel/nodes/subquery_join.rb', line 4 def constraints @constraints end |
#subquery ⇒ Object
Returns the value of attribute subquery.
4 5 6 |
# File 'lib/squeel/nodes/subquery_join.rb', line 4 def subquery @subquery end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/squeel/nodes/subquery_join.rb', line 4 def type @type end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
Compare with other objects
34 35 36 37 38 39 |
# File 'lib/squeel/nodes/subquery_join.rb', line 34 def eql?(other) self.class.eql?(other.class) && self.subquery.eql?(other.subquery) && self.type.eql?(other.type) && self.constraints.eql?(other.constraints) end |
#hash ⇒ Object
Implemented for equality testing
19 20 21 |
# File 'lib/squeel/nodes/subquery_join.rb', line 19 def hash [subquery, type, constraints].hash end |