Class: Array

Inherits:
Object show all
Defined in:
lib/utilrb/enumerable/random_element.rb

Instance Method Summary collapse

Instance Method Details

#random_elementObject

Returns a random element of the array


3
# File 'lib/utilrb/enumerable/random_element.rb', line 3

def random_element; self[rand(size)] end