Class: Mongoid::StringifiedSymbol
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/mongoid/stringified_symbol.rb |
Overview
A class which sends values to the database as Strings but returns them to the user as Symbols.
Class Method Summary
-
.demongoize(object) ⇒ Symbol
Internal use only
Internal use only
Convert the object from its mongo friendly ruby type to this type.
-
.evolve(object) ⇒ String
Internal use only
Internal use only
Turn the object from the Ruby type into the type type used in MQL queries.
-
.mongoize(object) ⇒ String
Internal use only
Internal use only
Turn the object from the Ruby type into the type type used for MongoDB persistence.
Class Method Details
.demongoize(object) ⇒ Symbol
This method is for internal use only.
Convert the object from its mongo friendly ruby type to this type.
# File 'lib/mongoid/stringified_symbol.rb', line 22
def demongoize(object) if object.nil? object else object.to_s.to_sym end end
.evolve(object) ⇒ String
This method is for internal use only.
Turn the object from the Ruby type into the type type used in MQL queries.
# File 'lib/mongoid/stringified_symbol.rb', line 60
def evolve(object) mongoize(object) end
.mongoize(object) ⇒ String
This method is for internal use only.
Turn the object from the Ruby type into the type type used for MongoDB persistence.
# File 'lib/mongoid/stringified_symbol.rb', line 41
def mongoize(object) if object.nil? object else object.to_s end end