Class: Contracts::Builtin::Neg

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

Class Method Summary collapse

Class Method Details

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



49
50
51
52
# File 'lib/contracts/builtin_ext.rb', line 49

def self.generate(min: -1_000, max: -1)
  raise 'max should not be greater than -1' if max > -1
  Num.generate(min: min, max: max).to_i
end