Sha256: 2534d499c4a34e5644086e93dc4cf2da079f5b7dff7f327b6a6b4d8e2e937fa5

Contents?: true

Size: 516 Bytes

Versions: 13

Compression:

Stored size: 516 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

module Mongoid
  module Matchable

    # Performs equivalency checks.
    class Eq < Default

      # Return true if the attribute and first value are equal.
      #
      # @example Do the values match?
      #   matcher._matches?({ :key => 10 })
      #
      # @param [ Hash ] value The values to check.
      #
      # @return [ true, false ] True if matches, false if not.
      def _matches?(value)
        super(value.values.first)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
mongoid-7.1.11 lib/mongoid/matchable/eq.rb
mongoid-7.1.10 lib/mongoid/matchable/eq.rb
mongoid-7.1.9 lib/mongoid/matchable/eq.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/lib/mongoid/matchable/eq.rb
mongoid-7.1.8 lib/mongoid/matchable/eq.rb
mongoid-7.1.7 lib/mongoid/matchable/eq.rb
mongoid-7.1.6 lib/mongoid/matchable/eq.rb
mongoid-7.1.5 lib/mongoid/matchable/eq.rb
mongoid-7.1.4 lib/mongoid/matchable/eq.rb
mongoid-7.1.2 lib/mongoid/matchable/eq.rb
mongoid-7.1.1 lib/mongoid/matchable/eq.rb
mongoid-7.1.0 lib/mongoid/matchable/eq.rb
mongoid-7.1.0.rc0 lib/mongoid/matchable/eq.rb