123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Criteria::Queryable::Extensions::Time

Relationships & Source Files
Namespace Children
Modules:
Defined in: lib/mongoid/criteria/queryable/extensions/time.rb

Overview

Adds query type-casting behavior to Time class.

Instance Method Summary

Instance Method Details

#__evolve_date__Time

Evolve the time as a date, UTC midnight.

Examples:

Evolve the time to a date query format.

time.__evolve_date__

Returns:

  • (Time)

    The date at midnight UTC.

[ GitHub ]

  
# File 'lib/mongoid/criteria/queryable/extensions/time.rb', line 18

def __evolve_date__
  ::Time.utc(year, month, day, 0, 0, 0, 0)
end

#__evolve_time__Time

Evolve the time into a utc time.

Examples:

Evolve the time.

time.__evolve_time__

Returns:

  • (Time)

    The time in UTC.

[ GitHub ]

  
# File 'lib/mongoid/criteria/queryable/extensions/time.rb', line 28

def __evolve_time__
  getutc
end