Class: Contracts::Builtin::Bool

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

Class Method Summary collapse

Class Method Details

.generate(true_ratio: 0.5) ⇒ Object



5
6
7
# File 'lib/contracts/builtin_ext.rb', line 5

def self.generate(true_ratio: 0.5)
  Random.rand < true_ratio
end