Sha256: 256f07c25b3a9bb1c7759071c8dfa7908f9710b8540f4daa082ecaba32ed1ef1

Contents?: true

Size: 623 Bytes

Versions: 37

Compression:

Stored size: 623 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Extensions
    module Regexp

      module ClassMethods

        # Turn the object from the ruby type we deal with to a Mongo friendly
        # type.
        #
        # @example Mongoize the object.
        #   Regexp.mongoize(/^[abc]/)
        #
        # @param [ Regexp, String ] object The object to mongoize.
        #
        # @return [ Regexp ] The object mongoized.
        #
        # @since 3.0.0
        def mongoize(object)
          ::Regexp.new(object)
        end
      end
    end
  end
end

::Regexp.__send__(:extend, Mongoid::Extensions::Regexp::ClassMethods)

Version data entries

37 entries across 37 versions & 5 rubygems

Version Path
mongoid-3.1.7 lib/mongoid/extensions/regexp.rb
mongoid-4.0.0.alpha1 lib/mongoid/extensions/regexp.rb
mongoid-3.1.6 lib/mongoid/extensions/regexp.rb
sepastian-mongoid-rails4-4.0.1.alpha lib/mongoid/extensions/regexp.rb
sepastian-mongoid-rails4-4.0.0.alpha lib/mongoid/extensions/regexp.rb
mongoid-3.1.5 lib/mongoid/extensions/regexp.rb
mongoid_heroku_stable-4.0.0 lib/mongoid/extensions/regexp.rb
mongoid_rails4-4.0.0 lib/mongoid/extensions/regexp.rb
mongoid-3.1.4 lib/mongoid/extensions/regexp.rb
mongoid-3.1.3 lib/mongoid/extensions/regexp.rb
mongoid-3.1.2 lib/mongoid/extensions/regexp.rb
mongoid-3.0.23 lib/mongoid/extensions/regexp.rb
mongoid-3.1.1 lib/mongoid/extensions/regexp.rb
mongoid-3.1.0 lib/mongoid/extensions/regexp.rb
mongoid-3.0.22 lib/mongoid/extensions/regexp.rb
mongoid-3.0.21 lib/mongoid/extensions/regexp.rb
mongoid-3.0.20 lib/mongoid/extensions/regexp.rb
mongoid-3.0.19 lib/mongoid/extensions/regexp.rb
mongoid-3.0.18 lib/mongoid/extensions/regexp.rb
mongoid-3.0.17 lib/mongoid/extensions/regexp.rb