Class: Array
Instance Method Summary collapse
-
#random_element ⇒ Object
Returns a random element of the array.
Instance Method Details
#random_element ⇒ Object
Returns a random element of the array
3 |
# File 'lib/utilrb/enumerable/random_element.rb', line 3 def random_element; self[rand(size)] end |