Class: MongoModel::Types::String

Inherits:
Object
  • Object
show all
Defined in:
lib/mongomodel/support/types/string.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/string.rb', line 4

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