Module: MongoidExtended::EpochTime::TimeDemongoize

Defined in:
lib/mongoid_extended/epoch_time.rb

Overview

Convert the object from its mongo friendly ruby type to this type.

Examples:

Demongoize the object.

Time.demongoize(object)

Returns:

  • (Integer)

    The object as a integer.

Since:

  • 3.0.0

Instance Method Summary collapse

Instance Method Details

#demongoize(object) ⇒ Object

Since:

  • 3.0.0



29
30
31
32
# File 'lib/mongoid_extended/epoch_time.rb', line 29

def demongoize(object)
  result = super
  result.nil? ? nil : result.to_i
end