Class: Range
Instance Method Summary collapse
Instance Method Details
#rand ⇒ Object
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 |