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.
127 128 129 |
# File 'lib/mongo_mapper/finder_options.rb', line 127 def initialize(field, operator) @field, @operator = field, operator end |
Instance Method Details
#to_criteria(value) ⇒ Object
131 132 133 |
# File 'lib/mongo_mapper/finder_options.rb', line 131 def to_criteria(value) {FinderOptions.normalized_field(@field) => {@operator => value}} end |