Sha256: 3e2535b242baab404e81d14e5246f00f26175ee0c9cc6a0c904d83db6e9ebae0

Contents?: true

Size: 502 Bytes

Versions: 14

Compression:

Stored size: 502 Bytes

Contents

module Mongoid
  module Matcher

    # This is an internal equality implementation that performs exact
    # comparisons and regular expression matches.
    #
    # @api private
    module EqImplWithRegexp
      module_function def matches?(original_operator, value, condition)
        case condition
        when Regexp
          value =~ condition
        when ::BSON::Regexp::Raw
          value =~ condition.compile
        else
          value == condition
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mongoid-7.3.5 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.3.4 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.2.6 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.3.3 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.3.2 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.2.5 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.2.4 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.3.1 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.3.0 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.2.3 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.2.2 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.2.1 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.2.0 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.2.0.rc1 lib/mongoid/matcher/eq_impl_with_regexp.rb