Module: Mongoid::Criteria::Queryable::Extensions::Range
- Defined in:
- build/mongoid-7.3/lib/mongoid/criteria/queryable/extensions/range.rb
Overview
This module contains additional range behavior.
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.
20 21 22 |
# File 'build/mongoid-7.3/lib/mongoid/criteria/queryable/extensions/range.rb', line 20 def __array__ to_a end |
#__evolve_date__ ⇒ Hash
Convert the range to a min/max mongo friendly query for dates.
32 33 34 |
# File 'build/mongoid-7.3/lib/mongoid/criteria/queryable/extensions/range.rb', line 32 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.
44 45 46 |
# File 'build/mongoid-7.3/lib/mongoid/criteria/queryable/extensions/range.rb', line 44 def __evolve_time__ { "$gte" => min.__evolve_time__, "$lte" => max.__evolve_time__ } end |