Class: Perpetuity::MongoDB::QueryUnion
- Inherits:
-
Object
- Object
- Perpetuity::MongoDB::QueryUnion
- Defined in:
- lib/perpetuity/mongodb/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
-
#initialize(lhs, rhs) ⇒ QueryUnion
constructor
A new instance of QueryUnion.
- #to_db ⇒ Object
Constructor Details
#initialize(lhs, rhs) ⇒ QueryUnion
Returns a new instance of QueryUnion.
6 7 8 9 |
# File 'lib/perpetuity/mongodb/query_union.rb', line 6 def initialize lhs, rhs @lhs = lhs @rhs = rhs end |
Instance Attribute Details
#lhs ⇒ Object (readonly)
Returns the value of attribute lhs.
4 5 6 |
# File 'lib/perpetuity/mongodb/query_union.rb', line 4 def lhs @lhs end |
#rhs ⇒ Object (readonly)
Returns the value of attribute rhs.
4 5 6 |
# File 'lib/perpetuity/mongodb/query_union.rb', line 4 def rhs @rhs end |
Instance Method Details
#to_db ⇒ Object
11 12 13 |
# File 'lib/perpetuity/mongodb/query_union.rb', line 11 def to_db { '$or' => [lhs.to_db, rhs.to_db] } end |