Class: RandomGenerators::Ruby

Inherits:
RandomGenerator show all
Defined in:
lib/random_generators/ruby.rb

Instance Method Summary collapse

Methods inherited from RandomGenerator

#check_choose_float, #check_choose_integer

Methods included from Abstract

included

Instance Method Details

#choose_float(f = 1.0) ⇒ Object



16
17
18
19
# File 'lib/random_generators/ruby.rb', line 16

def choose_float ( f=1.0 )
  check_choose_float(f)
  Kernel.rand() * f
end

#choose_integer(n) ⇒ Object



11
12
13
14
# File 'lib/random_generators/ruby.rb', line 11

def choose_integer ( n )
  check_choose_integer(n)
  Kernel.rand(n)
end