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.4.1 lib/mongoid/extensions/regexp.rb
mongoid-6.4.2 lib/mongoid/extensions/regexp.rb
mongoid-7.0.2 lib/mongoid/extensions/regexp.rb
mongoid-7.0.1 lib/mongoid/extensions/regexp.rb
mongoid-6.4.1 lib/mongoid/extensions/regexp.rb
mongoid-5.4.0 lib/mongoid/extensions/regexp.rb
tdiary-5.0.8 vendor/bundle/gems/mongoid-6.4.0/lib/mongoid/extensions/regexp.rb
mongoid-7.0.0 lib/mongoid/extensions/regexp.rb
mongoid-6.4.0 lib/mongoid/extensions/regexp.rb
mongoid-6.3.0 lib/mongoid/extensions/regexp.rb
mongoid-6.2.1 lib/mongoid/extensions/regexp.rb
mongoid-7.0.0.beta lib/mongoid/extensions/regexp.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongoid-6.1.0/lib/mongoid/extensions/regexp.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.1.0/lib/mongoid/extensions/regexp.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.2.0/lib/mongoid/extensions/regexp.rb
mongoid-6.2.0 lib/mongoid/extensions/regexp.rb
mongoid-6.1.1 lib/mongoid/extensions/regexp.rb
mongoid-5.2.1 lib/mongoid/extensions/regexp.rb
tdiary-5.0.4 vendor/bundle/gems/mongoid-6.1.0/lib/mongoid/extensions/regexp.rb
mongoid-6.1.0 lib/mongoid/extensions/regexp.rb