module Mongoid::Extensions::String::ClassMethods

Public Instance Methods

demongoize(object) click to toggle source

Convert the object from its mongo friendly ruby type to this type.

@example Demongoize the object.

String.demongoize(object)

@param [ Object ] object The object to demongoize.

@return [ String ] The object.

@since 3.0.0

# File lib/mongoid/extensions/string.rb, line 187
def demongoize(object)
  object.try(:to_s)
end
mongoize(object) click to toggle source

Turn the object from the ruby type we deal with to a Mongo friendly type.

@example Mongoize the object.

String.mongoize("123.11")

@param [ Object ] object The object to mongoize.

@return [ String ] The object mongoized.

@since 3.0.0

# File lib/mongoid/extensions/string.rb, line 202
def mongoize(object)
  demongoize(object)
end