Sha256: 0444e155d1ed609dc526b0f6cd29cc1c212bf28e9bb02528b6199cb6379db397

Contents?: true

Size: 612 Bytes

Versions: 54

Compression:

Stored size: 612 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.extend(Mongoid::Extensions::Regexp::ClassMethods)

Version data entries

54 entries across 49 versions & 3 rubygems

Version Path
mongoid-5.2.0 lib/mongoid/extensions/regexp.rb
mongoid-5.2.0.rc0 lib/mongoid/extensions/regexp.rb
mongoid-6.1.0.rc0 lib/mongoid/extensions/regexp.rb
mongoid-6.0.3 lib/mongoid/extensions/regexp.rb
mongoid-5.1.6 lib/mongoid/extensions/regexp.rb
mongoid-6.0.2 lib/mongoid/extensions/regexp.rb
mongoid-6.0.1 lib/mongoid/extensions/regexp.rb
mongoid-5.1.5 lib/mongoid/extensions/regexp.rb
mongoid-6.0.0 lib/mongoid/extensions/regexp.rb
mongoid-5.1.4 lib/mongoid/extensions/regexp.rb
mongoid-6.0.0.rc0 lib/mongoid/extensions/regexp.rb
mongoid-6.0.0.beta lib/mongoid/extensions/regexp.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mongoid-5.1.3/lib/mongoid/extensions/regexp.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mongoid-4.0.2/lib/mongoid/extensions/regexp.rb
mongoid-5.1.3 lib/mongoid/extensions/regexp.rb
mongoid-5.1.2 lib/mongoid/extensions/regexp.rb
mongoid-5.1.1 lib/mongoid/extensions/regexp.rb
mongoid-5.1.0 lib/mongoid/extensions/regexp.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mongoid-5.0.2/lib/mongoid/extensions/regexp.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mongoid-5.0.1/lib/mongoid/extensions/regexp.rb