instance method rand

Ruby on Rails 2.2.3

Since v2.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.

↑↓ navigate · open · esc close