Sha256: 9ecdabdecdebc318df8396ce639d91fd234773e4b04b7d343b588ceb58b77a0c

Contents?: true

Size: 504 Bytes

Versions: 188

Compression:

Stored size: 504 Bytes

Contents

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

    # Performs size checking.
    class Size < Default

      # Return true if the attribute size is equal to the first value.
      #
      # @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.size == value.values.first
      end
    end
  end
end

Version data entries

188 entries across 96 versions & 4 rubygems

Version Path
classiccms-0.5.9 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/matchers/size.rb
classiccms-0.5.9 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/matchers/size.rb
classiccms-0.5.9 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/matchers/size.rb
classiccms-0.5.8 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/matchers/size.rb
classiccms-0.5.8 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/matchers/size.rb
classiccms-0.5.8 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/matchers/size.rb
classiccms-0.5.7 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/matchers/size.rb
classiccms-0.5.7 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/matchers/size.rb
classiccms-0.5.7 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/matchers/size.rb
classiccms-0.5.6 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/matchers/size.rb
classiccms-0.5.6 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/matchers/size.rb
classiccms-0.5.6 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/matchers/size.rb
classiccms-0.5.5 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/matchers/size.rb
classiccms-0.5.5 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/matchers/size.rb
classiccms-0.5.5 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/matchers/size.rb
classiccms-0.5.2 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/matchers/size.rb
classiccms-0.5.2 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/matchers/size.rb
classiccms-0.5.2 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/matchers/size.rb
classiccms-0.5.1 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/matchers/size.rb
classiccms-0.5.1 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/matchers/size.rb