Class: MongoMapper::FinderOperator

Inherits:
Object
  • Object
show all
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

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