Sha256: ffa32a81010e86df24e0b132d5d5ec392df734c22bbb9b2ca2d96999ed798117

Contents?: true

Size: 486 Bytes

Versions: 4

Compression:

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

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
sepastian-mongoid-rails4-4.0.1.alpha lib/mongoid/matchable/ne.rb
sepastian-mongoid-rails4-4.0.0.alpha lib/mongoid/matchable/ne.rb
mongoid_heroku_stable-4.0.0 lib/mongoid/matchable/ne.rb
mongoid_rails4-4.0.0 lib/mongoid/matchable/ne.rb