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

Defined in:
lib/mongoid/extensions/string.rb

Instance Method Summary (collapse)

Instance Method Details

- (String) demongoize(object)

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

Examples:

Demongoize the object.

String.demongoize(object)

Since:

  • 3.0.0



175
176
177
# File 'lib/mongoid/extensions/string.rb', line 175

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

- (String) mongoize(object)

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

Examples:

Mongoize the object.

String.mongoize("123.11")

Since:

  • 3.0.0



190
191
192
# File 'lib/mongoid/extensions/string.rb', line 190

def mongoize(object)
  demongoize(object)
end