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.



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