Class: MongoMapper::FinderOperator
- Defined in:
- lib/mongo_mapper/finder_options.rb
Instance Method Summary collapse
-
#initialize(field, operator) ⇒ FinderOperator
constructor
A new instance of FinderOperator.
- #to_criteria(value) ⇒ Object
Constructor Details
#initialize(field, operator) ⇒ FinderOperator
Returns a new instance of FinderOperator.
125 126 127 |
# File 'lib/mongo_mapper/finder_options.rb', line 125 def initialize(field, operator) @field, @operator = field, operator end |
Instance Method Details
#to_criteria(value) ⇒ Object
129 130 131 |
# File 'lib/mongo_mapper/finder_options.rb', line 129 def to_criteria(value) {@field => {@operator => value}} end |