Class: Contracts::Builtin::Not
- Inherits:
-
CallableClass
- Object
- CallableClass
- Contracts::Builtin::Not
- Defined in:
- lib/contracts/builtin_contracts.rb
Overview
Takes a variable number of contracts. The contract passes if all of those contracts fail for the given argument. Example: Not[nil]
Instance Method Summary collapse
-
#initialize(*vals) ⇒ Not
constructor
A new instance of Not.
- #to_s ⇒ Object
- #valid?(val) ⇒ Boolean
Methods inherited from CallableClass
Constructor Details
#initialize(*vals) ⇒ Not
Returns a new instance of Not.
253 254 255 |
# File 'lib/contracts/builtin_contracts.rb', line 253 def initialize(*vals) @vals = vals end |
Instance Method Details
#to_s ⇒ Object
264 265 266 |
# File 'lib/contracts/builtin_contracts.rb', line 264 def to_s "a value that is none of #{@vals.inspect}" end |