123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Extensions::String::ClassMethods

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Extended In:
Defined in: lib/mongoid/extensions/string.rb

Instance Method Summary

Instance Method Details

#demongoize(object)

Alias for #mongoize.

[ GitHub ]

  
# File 'lib/mongoid/extensions/string.rb', line 172

alias :demongoize :mongoize

#mongoize(object) ⇒ String Also known as: #demongoize

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

Examples:

Mongoize the object.

String.mongoize("123.11")

Parameters:

  • object (Object)

    The object to mongoize.

Returns:

  • (String)

    The object mongoized.

[ GitHub ]

  
# File 'lib/mongoid/extensions/string.rb', line 169

def mongoize(object)
  object.try(:to_s)
end