Sha256: 1672cf8ee51d316995030b3968199709d758e5fa63b12a7a7325cb2d582fdd1c

Contents?: true

Size: 683 Bytes

Versions: 27

Compression:

Stored size: 683 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
          if Mongoid.compare_time_by_ms &&
            value.kind_of?(Time) && condition.kind_of?(Time)
            EqImpl.time_eq?(value, condition)
          else
            value == condition
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
mongoid-8.1.9 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.0.9 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.1.8 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.1.7 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.1.6 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.0.8 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.1.5 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.1.4 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.0.7 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.1.3 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.1.2 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.0.6 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.5.4 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.1.1 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.0.5 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.1.0 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.5.3 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.0.4 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-8.0.3 lib/mongoid/matcher/eq_impl_with_regexp.rb
mongoid-7.5.2 lib/mongoid/matcher/eq_impl_with_regexp.rb