Module: Mongoid::Criteria::Queryable::Extensions::Range
- Defined in:
- build/mongoid-6.1/lib/mongoid/criteria/queryable/extensions/range.rb
Overview
This module contains additional range behaviour.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#__array__ ⇒ Array
Get the range as an array.
-
#__evolve_date__ ⇒ Hash
Convert the range to a min/max mongo friendly query for dates.
-
#__evolve_time__ ⇒ Hash
Convert the range to a min/max mongo friendly query for times.
Instance Method Details
#__array__ ⇒ Array
Get the range as an array.
18 19 20 |
# File 'build/mongoid-6.1/lib/mongoid/criteria/queryable/extensions/range.rb', line 18 def __array__ to_a end |
#__evolve_date__ ⇒ Hash
Convert the range to a min/max mongo friendly query for dates.
30 31 32 |
# File 'build/mongoid-6.1/lib/mongoid/criteria/queryable/extensions/range.rb', line 30 def __evolve_date__ { "$gte" => min.__evolve_date__, "$lte" => max.__evolve_date__ } end |
#__evolve_time__ ⇒ Hash
Convert the range to a min/max mongo friendly query for times.
42 43 44 |
# File 'build/mongoid-6.1/lib/mongoid/criteria/queryable/extensions/range.rb', line 42 def __evolve_time__ { "$gte" => min.__evolve_time__, "$lte" => max.__evolve_time__ } end |