Class: MongoMapper::FinderOperator

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo_mapper/finder_options.rb

Instance Method Summary collapse

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