Class: Perpetuity::Postgres::QueryIntersection
- Inherits:
-
Object
- Object
- Perpetuity::Postgres::QueryIntersection
- Defined in:
- lib/perpetuity/postgres/query_intersection.rb
Instance Attribute Summary collapse
-
#lhs ⇒ Object
readonly
Returns the value of attribute lhs.
-
#rhs ⇒ Object
readonly
Returns the value of attribute rhs.
Instance Method Summary collapse
- #&(other) ⇒ Object
-
#initialize(lhs, rhs) ⇒ QueryIntersection
constructor
A new instance of QueryIntersection.
- #to_db ⇒ Object
- #|(other) ⇒ Object
Constructor Details
#initialize(lhs, rhs) ⇒ QueryIntersection
Returns a new instance of QueryIntersection.
8 9 10 11 |
# File 'lib/perpetuity/postgres/query_intersection.rb', line 8 def initialize lhs, rhs @lhs = lhs @rhs = rhs end |
Instance Attribute Details
#lhs ⇒ Object (readonly)
Returns the value of attribute lhs.
6 7 8 |
# File 'lib/perpetuity/postgres/query_intersection.rb', line 6 def lhs @lhs end |
#rhs ⇒ Object (readonly)
Returns the value of attribute rhs.
6 7 8 |
# File 'lib/perpetuity/postgres/query_intersection.rb', line 6 def rhs @rhs end |
Instance Method Details
#&(other) ⇒ Object
17 18 19 |
# File 'lib/perpetuity/postgres/query_intersection.rb', line 17 def & other QueryIntersection.new(self, other) end |
#to_db ⇒ Object
13 14 15 |
# File 'lib/perpetuity/postgres/query_intersection.rb', line 13 def to_db "(#{lhs.to_db} AND #{rhs.to_db})" end |
#|(other) ⇒ Object
21 22 23 |
# File 'lib/perpetuity/postgres/query_intersection.rb', line 21 def | other QueryUnion.new(self, other) end |