Class: Contracts::Pos
- Inherits:
-
Object
- Object
- Contracts::Pos
- Defined in:
- lib/contracts/builtin_contracts.rb
Overview
Check that an argument is a positive number.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.test_data ⇒ Object
46 47 48 |
# File 'lib/contracts/builtin_contracts.rb', line 46 def self.test_data (0..5).map { rand(999) + 1 } end |
.valid?(val) ⇒ Boolean
38 39 40 |
# File 'lib/contracts/builtin_contracts.rb', line 38 def self.valid? val val > 0 end |
Instance Method Details
#testable? ⇒ Boolean
42 43 44 |
# File 'lib/contracts/builtin_contracts.rb', line 42 def testable? true end |