Module: Mongoid::Extensions::Regexp::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#mongoize(object) ⇒ Regexp

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

Examples:

Mongoize the object.

Regexp.mongoize(/^[abc]/)

Parameters:

Returns:

  • (Regexp)

    The object mongoized.

Since:

  • 3.0.0



19
20
21
# File 'lib/mongoid/extensions/regexp.rb', line 19

def mongoize(object)
  ::Regexp.new(object)
end