Sha256: 59ff32a07665fa4ebde942f6c1cd2633565d33b589f4d6f189aadd934c82ebb5
Contents?: true
Size: 648 Bytes
Versions: 9
Compression:
Stored size: 648 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) return nil if object.nil? ::Regexp.new(object) end end end end end ::Regexp.extend(Mongoid::Extensions::Regexp::ClassMethods)
Version data entries
9 entries across 9 versions & 1 rubygems