instance method rand

Ruby on Rails 2.2.3

Last seen in v2.2.3

Signature

rand()

Returns a random element from the array.

Source
# File activesupport/lib/active_support/core_ext/array/random_access.rb, line 6
        def rand
          self[Kernel.rand(length)]
        end

Defined in activesupport/lib/active_support/core_ext/array/random_access.rb line 6 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::CoreExtensions::Array::RandomAccess

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close