Module: ActiveSupport::CoreExtensions::Array::RandomAccess

Included in:
Array
Defined in:
lib/support/active_support_lite/array/random_access.rb

Instance Method Summary collapse

Instance Method Details

#randObject

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