Methods
Public Instance methods
Returns a random element from the array.
[ show source ]
# File activesupport/lib/active_support/core_ext/array/random_access.rb, line 16 16: def random_element 17: self[Kernel.rand(length)] 18: end
Module ActiveSupport::CoreExtensions::Array::RandomAccess |
|
Returns a random element from the array.
[ show source ]
# File activesupport/lib/active_support/core_ext/array/random_access.rb, line 16 16: def random_element 17: self[Kernel.rand(length)] 18: end