Sha256: 230f99d51d7e1c83d81be6c99eead1026f238cf1f47bd94ed688e9b87f9ac0f9
Contents?: true
Size: 748 Bytes
Versions: 10
Compression:
Stored size: 748 Bytes
Contents
# frozen_string_literal: true # encoding: utf-8 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?(/\AEm/) # matcher._matches?(BSON::Regex::Raw.new("\\AEm")) # # @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
10 entries across 10 versions & 2 rubygems