Class: Symbol

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

.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

Instance Method Details

#to_mongoObject



94
95
96
# File 'lib/mongo_odm/core_ext/conversions.rb', line 94

def to_mongo
  self
end