Class: Contracts::Builtin::Nat

Inherits:
Object
  • Object
show all
Defined in:
lib/contracts/builtin_ext.rb

Class Method Summary collapse

Class Method Details

.generate(min: 0, max: 1_000) ⇒ Object



63
64
65
66
# File 'lib/contracts/builtin_ext.rb', line 63

def self.generate(min: 0, max: 1_000)
  raise 'min should not be less than 0' if min < 0
  Num.generate(min: min, max: max).to_i
end