Class: Contracts::Neg
- Inherits:
-
Object
- Object
- Contracts::Neg
- Defined in:
- lib/contracts/builtin_contracts.rb
Overview
Check that an argument is a negative number.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.test_data ⇒ Object
62 63 64 |
# File 'lib/contracts/builtin_contracts.rb', line 62 def self.test_data (0..5).map { (rand(999) + 1) * -1 } end |
.valid?(val) ⇒ Boolean
54 55 56 |
# File 'lib/contracts/builtin_contracts.rb', line 54 def self.valid? val val < 0 end |
Instance Method Details
#testable? ⇒ Boolean
58 59 60 |
# File 'lib/contracts/builtin_contracts.rb', line 58 def testable? true end |