Sha256: ea07ebed205e31ccde5923c7dad5f277134c7e419655075c25e45d2b6f9a2c00

Contents?: true

Size: 485 Bytes

Versions: 31

Compression:

Stored size: 485 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Matchers

    # 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

31 entries across 31 versions & 2 rubygems

Version Path
mongoid-3.1.6 lib/mongoid/matchers/ne.rb
mongoid-3.1.5 lib/mongoid/matchers/ne.rb
mongoid-3.1.4 lib/mongoid/matchers/ne.rb
mongoid-3.1.3 lib/mongoid/matchers/ne.rb
mongoid-3.1.2 lib/mongoid/matchers/ne.rb
mongoid-3.0.23 lib/mongoid/matchers/ne.rb
mongoid-3.1.1 lib/mongoid/matchers/ne.rb
mongoid-3.1.0 lib/mongoid/matchers/ne.rb
mongoid-3.0.22 lib/mongoid/matchers/ne.rb
mongoid-3.0.21 lib/mongoid/matchers/ne.rb
mongoid-3.0.20 lib/mongoid/matchers/ne.rb
mongoid-3.0.19 lib/mongoid/matchers/ne.rb
mongoid-3.0.18 lib/mongoid/matchers/ne.rb
mongoid-3.0.17 lib/mongoid/matchers/ne.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.16/lib/mongoid/matchers/ne.rb
mongoid-3.0.16 lib/mongoid/matchers/ne.rb
mongoid-3.0.15 lib/mongoid/matchers/ne.rb
mongoid-3.0.14 lib/mongoid/matchers/ne.rb
mongoid-3.0.13 lib/mongoid/matchers/ne.rb
mongoid-3.0.12 lib/mongoid/matchers/ne.rb