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