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
61 62 63 |
# File 'lib/contracts/builtin_contracts.rb', line 61 def self.test_data (0..5).map { (rand(999) + 1) * -1 } end |
.valid?(val) ⇒ Boolean
53 54 55 |
# File 'lib/contracts/builtin_contracts.rb', line 53 def self.valid? val val < 0 end |
Instance Method Details
#testable? ⇒ Boolean
57 58 59 |
# File 'lib/contracts/builtin_contracts.rb', line 57 def testable? true end |