Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo_odm/core_ext/conversions.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) type_cast(value)



201
202
203
204
# File 'lib/mongo_odm/core_ext/conversions.rb', line 201

def self.type_cast(value)
  return nil if value.nil?
  value.to_time
end

Instance Method Details

- (Object) to_mongo



206
207
208
# File 'lib/mongo_odm/core_ext/conversions.rb', line 206

def to_mongo
  self.utc
end