Sha256: 45b5ab4323cea986548cbb6c5865aaf7d5da02ed2cc12bea566cfbfa6eb171ec

Contents?: true

Size: 515 Bytes

Versions: 10

Compression:

Stored size: 515 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

10 entries across 10 versions & 1 rubygems

Version Path
mongoid-7.0.13 lib/mongoid/matchable/eq.rb
mongoid-7.0.12 lib/mongoid/matchable/eq.rb
mongoid-7.0.11 lib/mongoid/matchable/eq.rb
mongoid-7.0.10 lib/mongoid/matchable/eq.rb
mongoid-7.0.8 lib/mongoid/matchable/eq.rb
mongoid-7.0.7 lib/mongoid/matchable/eq.rb
mongoid-7.0.6 lib/mongoid/matchable/eq.rb
mongoid-7.0.5 lib/mongoid/matchable/eq.rb
mongoid-7.0.4 lib/mongoid/matchable/eq.rb
mongoid-7.0.3 lib/mongoid/matchable/eq.rb