Class: MongoMapper::FinderOperator
- Defined in:
- lib/mongo_mapper/finder_options.rb
Overview
Controls the parsing and handling of options used by finders.
Important Note
This class is private to MongoMapper and should not be considered part of MongoMapper’s public API. Some documentation herein, however, may prove useful for understanding how MongoMapper handles the parsing of finder conditions and options.
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.
13 14 15 |
# File 'lib/mongo_mapper/finder_options.rb', line 13 def initialize(field, operator) @field, @operator = field, operator end |
Instance Method Details
#to_criteria(value) ⇒ Object
17 18 19 |
# File 'lib/mongo_mapper/finder_options.rb', line 17 def to_criteria(value) {@field => {@operator => value}} end |