Class: MongoModel::Types::Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/mongomodel/support/types/symbol.rb

Instance Method Summary collapse

Methods inherited from Object

#boolean, #from_mongo, #to_mongo, #to_query

Instance Method Details

#cast(value) ⇒ Object



4
5
6
# File 'lib/mongomodel/support/types/symbol.rb', line 4

def cast(value)
  value.to_sym if value && value.respond_to?(:to_sym)
end