Class: Float

Inherits:
Object show all
Defined in:
lib/choose.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.choose(limit = nil, generator = nil) ⇒ Object



25
26
27
# File 'lib/choose.rb', line 25

def self.choose ( limit=nil, generator=nil )
  (limit || 1.0).to_f.choose(generator)
end

Instance Method Details

#choose(generator = nil) ⇒ Object



29
30
31
# File 'lib/choose.rb', line 29

def choose ( generator=nil )
  (generator || RandomGenerators.default).choose_float(self)
end