Class: Contracts::Builtin::Pos
- Inherits:
-
Object
- Object
- Contracts::Builtin::Pos
- Defined in:
- lib/contracts/builtin_contracts.rb
Overview
Check that an argument is a positive number.
Class Method Summary collapse
Class Method Details
.valid?(val) ⇒ Boolean
28 29 30 |
# File 'lib/contracts/builtin_contracts.rb', line 28 def self.valid?(val) val && val.is_a?(Numeric) && val > 0 end |