Method: Mongoid::Extensions::Float#__mongoize_time__

Defined in:
lib/mongoid/extensions/float.rb

#__mongoize_time__Time | ActiveSupport::TimeWithZone

Converts the float into a time as the number of seconds since the epoch.

Examples:

Convert the float into a time.

1335532685.117847.__mongoize_time__

Returns:

  • (Time | ActiveSupport::TimeWithZone)

    The time.



16
17
18
# File 'lib/mongoid/extensions/float.rb', line 16

def __mongoize_time__
  ::Time.zone.at(self)
end