Sha256: 8dcc18407b319f2c31026a40a88e016777fbf01b0466229dcad24d285067f4e5

Contents?: true

Size: 487 Bytes

Versions: 46

Compression:

Stored size: 487 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Matchable

    # 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

46 entries across 42 versions & 6 rubygems

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