Sha256: 9b51e2208f2e0e52cfe25cb25581dd35c2e68de793426d46452a3c7cfaab861e
Contents?: true
Size: 696 Bytes
Versions: 22
Compression:
Stored size: 696 Bytes
Contents
module Mongoid module Matchable # Defines behavior for handling regular expressions in embedded documents. class Regexp < Default # Does the supplied query match the attribute? # # @example Does this match? # matcher._matches?(/^Em/) # matcher._matches?(BSON::Regex::Raw.new("^Em")) # # @param [ BSON::Regexp::Raw, Regexp ] regexp The regular expression object. # # @return [ true, false ] True if matches, false if not. # # @since 5.2.1 def _matches?(regexp) if native_regexp = regexp.try(:compile) super(native_regexp) else super end end end end end
Version data entries
22 entries across 22 versions & 2 rubygems