Sha256: cbb6932a7d06af0d85a0f63680f7c7f5c6d980228a1e25a80e79cde02ad4cb93
Contents?: true
Size: 629 Bytes
Versions: 8
Compression:
Stored size: 629 Bytes
Contents
# frozen_string_literal: true 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. 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
8 entries across 8 versions & 1 rubygems