Module: Mongoid::Criteria::Queryable::Extensions::Numeric
| Relationships & Source Files | |
| Namespace Children | |
|
Modules:
| |
| Defined in: | lib/mongoid/criteria/queryable/extensions/numeric.rb |
Overview
Adds query type-casting behavior to Numeric module and its children.
Instance Method Summary
-
#__evolve_date__ ⇒ Time
Evolve the numeric value into a mongo friendly date, aka UTC time at midnight.
-
#__evolve_time__ ⇒ Time
Evolve the numeric value into a mongo friendly time.
Instance Method Details
#__evolve_date__ ⇒ Time
Evolve the numeric value into a mongo friendly date, aka UTC time at midnight.
# File 'lib/mongoid/criteria/queryable/extensions/numeric.rb', line 16
def __evolve_date__ time = ::Time.at(self).utc ::Time.utc(time.year, time.month, time.day, 0, 0, 0, 0) end
#__evolve_time__ ⇒ Time
Evolve the numeric value into a mongo friendly time.
# File 'lib/mongoid/criteria/queryable/extensions/numeric.rb', line 27
def __evolve_time__ ::Time.at(self).utc end