Sha256: a9a28fd136f8a4c45db498da50ed3e6d80b8dc4d6ec0d34596b00df1370b3177

Contents?: true

Size: 494 Bytes

Versions: 10

Compression:

Stored size: 494 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Matchable

    # Performs non-equivalency checks.
    class Ne < Default

      # Return true if the attribute and first value are not 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/ne.rb
mongoid-7.0.12 lib/mongoid/matchable/ne.rb
mongoid-7.0.11 lib/mongoid/matchable/ne.rb
mongoid-7.0.10 lib/mongoid/matchable/ne.rb
mongoid-7.0.8 lib/mongoid/matchable/ne.rb
mongoid-7.0.7 lib/mongoid/matchable/ne.rb
mongoid-7.0.6 lib/mongoid/matchable/ne.rb
mongoid-7.0.5 lib/mongoid/matchable/ne.rb
mongoid-7.0.4 lib/mongoid/matchable/ne.rb
mongoid-7.0.3 lib/mongoid/matchable/ne.rb