Takes a class A. If argument is object of type A,
the contract passes. If it is a subclass of A (or not related to A in any
way), it fails. Example: Exactly[Numeric]
# File lib/contracts/builtin_contracts.rb, line 206 def initialize(cls) @cls = cls end
# File lib/contracts/builtin_contracts.rb, line 214 def to_s "exactly #{@cls.inspect}" end
# File lib/contracts/builtin_contracts.rb, line 210 def valid?(val) val.class == @cls end