module Mongoid::Extensions::Time

Constants

EPOCH

Constant for epoch - used when passing invalid times.

@deprecated No longer used as a return value from mongoize passed

an invalid time string.

Public Instance Methods

__mongoize_time__() click to toggle source

Mongoizes a Time into a time.

Time always mongoize into Time instances (which are themselves).

@return [ Time ] self.

@since 3.0.0

# File lib/mongoid/extensions/time.rb, line 16
def __mongoize_time__
  self
end
mongoize() click to toggle source

Turn the object from the ruby type we deal with to a Mongo friendly type.

@example Mongoize the object.

time.mongoize

@return [ Time ] The object mongoized.

@since 3.0.0

# File lib/mongoid/extensions/time.rb, line 35
def mongoize
  ::Time.mongoize(self)
end