Module: ActiveSupport::CoreExtensions::Array::RandomAccess
- Included in:
- Array
- Defined in:
- lib/active_support/core_ext/array/random_access.rb
Instance Method Summary collapse
-
#rand ⇒ Object
Returns a random element from the array.
Instance Method Details
#rand ⇒ Object
Returns a random element from the array.
6 7 8 |
# File 'lib/active_support/core_ext/array/random_access.rb', line 6 def rand self[Kernel.rand(length)] end |