Class: Class

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)



73
74
75
76
# File 'lib/mongo_odm/core_ext/conversions.rb', line 73

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

Instance Method Details

- (Object) to_mongo



78
79
80
# File 'lib/mongo_odm/core_ext/conversions.rb', line 78

def to_mongo
  self.name
end