Module: RushCheck::RandomBool

Included in:
FalseClass, TrueClass
Defined in:
lib/rushcheck/bool.rb

Instance Method Summary collapse

Instance Method Details

#arbitraryObject



12
13
14
# File 'lib/rushcheck/bool.rb', line 12

def arbitrary
  RushCheck::Gen.elements([true, false])
end

#random_range(gen, lo = @@min_bound, hi = @@max_bound) ⇒ Object



16
17
18
19
# File 'lib/rushcheck/bool.rb', line 16

def random_range(gen, lo=@@min_bound, hi=@@max_bound)
  v, g = Integer.random_range(gen, 0, 1)
  [v==0, g]
end