Module: ActiveSupport::CoreExtensions::Array::RandomAccess
- Included in:
- Array
- Defined in:
- lib/support/active_support_lite/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. :nodoc
7 8 9 |
# File 'lib/support/active_support_lite/array/random_access.rb', line 7 def rand self[Kernel.rand(length)] end |