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-5.4.1 lib/mongoid/matchable/size.rb
mongoid-5.4.0 lib/mongoid/matchable/size.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.1.0/lib/mongoid/matchable/size.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongoid-6.1.0/lib/mongoid/matchable/size.rb
mongoid-5.2.1 lib/mongoid/matchable/size.rb
tdiary-5.0.4 vendor/bundle/gems/mongoid-6.1.0/lib/mongoid/matchable/size.rb
mongoid-6.1.0 lib/mongoid/matchable/size.rb
mongoid-5.2.0 lib/mongoid/matchable/size.rb
mongoid-5.2.0.rc0 lib/mongoid/matchable/size.rb
mongoid-6.1.0.rc0 lib/mongoid/matchable/size.rb
mongoid-6.0.3 lib/mongoid/matchable/size.rb
mongoid-5.1.6 lib/mongoid/matchable/size.rb
mongoid-6.0.2 lib/mongoid/matchable/size.rb
mongoid-6.0.1 lib/mongoid/matchable/size.rb
mongoid-5.1.5 lib/mongoid/matchable/size.rb
mongoid-6.0.0 lib/mongoid/matchable/size.rb
mongoid-5.1.4 lib/mongoid/matchable/size.rb
mongoid-6.0.0.rc0 lib/mongoid/matchable/size.rb
mongoid-6.0.0.beta lib/mongoid/matchable/size.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mongoid-4.0.2/lib/mongoid/matchable/size.rb