Module: Origin::Extensions::Range
- Defined in:
- lib/origin/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.
16 17 18 |
# File 'lib/origin/extensions/range.rb', line 16 def __array__ to_a end |
#__evolve_date__ ⇒ Hash
Convert the range to a min/max mongo friendly query for dates.
28 29 30 |
# File 'lib/origin/extensions/range.rb', line 28 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.
40 41 42 |
# File 'lib/origin/extensions/range.rb', line 40 def __evolve_time__ { "$gte" => min.__evolve_time__, "$lte" => max.__evolve_time__ } end |