Sha256: 0da472d6a9ea3bffcfe09a225d850cfe8177002fb83ed30feefa688278a461c1

Contents?: true

Size: 503 Bytes

Versions: 188

Compression:

Stored size: 503 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Matchers #:nodoc:

    # 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 ] If a value exists.
      def matches?(value)
        @attribute != value.values.first
      end
    end
  end
end

Version data entries

188 entries across 96 versions & 4 rubygems

Version Path
mongoid-2.1.7 lib/mongoid/matchers/ne.rb
mongoid-2.1.6 lib/mongoid/matchers/ne.rb
mongoid-2.1.5 lib/mongoid/matchers/ne.rb
mongoid-2.1.4 lib/mongoid/matchers/ne.rb
mongoid-2.1.3 lib/mongoid/matchers/ne.rb
mongoid-2.1.2 lib/mongoid/matchers/ne.rb
mongoid-2.1.1 lib/mongoid/matchers/ne.rb
mongoid-2.1.0 lib/mongoid/matchers/ne.rb