Class: Range

Inherits:
Object show all
Defined in:
lib/shoes/ruby.rb

Instance Method Summary collapse

Instance Method Details

#randObject



2
3
4
5
# File 'lib/shoes/ruby.rb', line 2

def rand 
  conv = (Integer === self.end && Integer === self.begin ? :to_i : :to_f)
  ((Kernel.rand * (self.end - self.begin)) + self.begin).send(conv) 
end