Sha256: 3d4110608ea038ff22fae28fa4f5efcc1da51e15e522df40b87bd721d885afc6
Contents?: true
Size: 680 Bytes
Versions: 24
Compression:
Stored size: 680 Bytes
Contents
# frozen_string_literal: true # 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(/\A[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
24 entries across 24 versions & 2 rubygems