Module: Mongoid::Criteria::Queryable::Extensions::Range::ClassMethods
Relationships & Source Files | |
Defined in: | lib/mongoid/criteria/queryable/extensions/range.rb |
Instance Method Summary
-
#evolve(object) ⇒ Hash
Evolve the range.
Instance Method Details
#evolve(object) ⇒ Hash
Evolve the range. This will transform it into a $gte/$lte selection. Endless and beginning-less ranges will use only $gte or $lte respectively. End-excluded ranges (…) will use $lt selector instead of $lte.
# File 'lib/mongoid/criteria/queryable/extensions/range.rb', line 91
def evolve(object) return object unless object.is_a?(::Range) object.__evolve_range__ end