Method: Symbol.type_cast

Defined in:
lib/mongo_odm/core_ext/conversions.rb

.type_cast(value) ⇒ Object



85
86
87
88
89
90
91
92
# File 'lib/mongo_odm/core_ext/conversions.rb', line 85

def self.type_cast(value)
  case value
    when nil then nil
    when Symbol then value
    when String then value.intern
    else value.inspect.intern
  end
end