Class: Contracts::Builtin::Neg
- Inherits:
-
Object
- Object
- Contracts::Builtin::Neg
- Defined in:
- lib/contracts/builtin_contracts.rb
Overview
Check that an argument is a negative number.
Class Method Summary collapse
Class Method Details
.valid?(val) ⇒ Boolean
41 42 43 |
# File 'lib/contracts/builtin_contracts.rb', line 41 def self.valid? val val.is_a?(Numeric) && val.negative? end |