Sha256: fd0f4c1fd215bfad1614f6cdc9dc01d90cea6770071ef97e6fd1fef62764019d

Contents?: true

Size: 108 Bytes

Versions: 5

Compression:

Stored size: 108 Bytes

Contents

class Array
  # Returns a random element from the array.
  def rand
    self[Kernel.rand(length)]
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
activesupport-3.0.0.beta3 lib/active_support/core_ext/array/random_access.rb
activesupport-3.0.0.beta2 lib/active_support/core_ext/array/random_access.rb
activesupport-3.0.0.beta lib/active_support/core_ext/array/random_access.rb
activesupport-3.0.pre lib/active_support/core_ext/array/random_access.rb
recliner-0.0.1 vendor/activesupport/lib/active_support/core_ext/array/random_access.rb