Class: Range

Inherits:
Object show all
Defined in:
lib/rbot/core/utils/extends.rb

Overview

Extensions to the Range class

Instance Method Summary collapse

Instance Method Details

#pick_oneObject Also known as: rand

This method returns a random number between the lower and upper bound



179
180
181
182
183
# File 'lib/rbot/core/utils/extends.rb', line 179

def pick_one
  len = self.last - self.first
  len += 1 unless self.exclude_end?
  self.first + Kernel::rand(len)
end