Class: Range

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

Instance Method Summary collapse

Instance Method Details

#randObject



34
35
36
37
# File 'lib/shoes.rb', line 34

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