Class: SymbolOperator
- Inherits:
-
Object
- Object
- SymbolOperator
- Defined in:
- lib/mongomodel/compatibility/mongo_mapper.rb
Instance Method Summary collapse
Instance Method Details
#eql?(other) ⇒ Boolean
10 11 12 |
# File 'lib/mongomodel/compatibility/mongo_mapper.rb', line 10 def eql?(other) self == other end |
#hash ⇒ Object
14 15 16 |
# File 'lib/mongomodel/compatibility/mongo_mapper.rb', line 14 def hash field.hash ^ operator.hash end |
#to_mongo_operator ⇒ Object
2 3 4 |
# File 'lib/mongomodel/compatibility/mongo_mapper.rb', line 2 def to_mongo_operator MongoModel::MongoOperator.new(field, operator) end |
#to_mongo_order_clause ⇒ Object
6 7 8 |
# File 'lib/mongomodel/compatibility/mongo_mapper.rb', line 6 def to_mongo_order_clause MongoModel::MongoOrder::Clause.new(field, operator.to_s == 'asc' ? :ascending : :descending) end |