Sha256: 6ad862fca453a9177248602d0de93b477b76d7fe0e35243f441160ba4ee24f30

Contents?: true

Size: 258 Bytes

Versions: 21

Compression:

Stored size: 258 Bytes

Contents

module ActiveSupport #:nodoc:
  module CoreExtensions #:nodoc:
    module Array #:nodoc:
      module RandomAccess
        # Return a random element from the array.
        def rand
          self[Kernel.rand(length)]
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
activesupport-2.0.0 lib/active_support/core_ext/array/random_access.rb
activesupport-2.0.1 lib/active_support/core_ext/array/random_access.rb
activesupport-2.0.2 lib/active_support/core_ext/array/random_access.rb
activesupport-2.0.4 lib/active_support/core_ext/array/random_access.rb
activesupport-2.0.5 lib/active_support/core_ext/array/random_access.rb
radiant-0.6.5.1 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiant-0.6.5 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiant-0.6.6 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiant-0.6.7 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiant-0.6.8 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiant-0.6.9 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
spree-0.0.9 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
spree-0.2.0 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
swivel-0.0.150 vendor/activesupport-2.0.2-/lib/active_support/core_ext/array/random_access.rb
swivel-0.0.149 vendor/activesupport-2.0.2-/lib/active_support/core_ext/array/random_access.rb
swivel-0.0.152 vendor/activesupport-2.0.2-/lib/active_support/core_ext/array/random_access.rb
swivel-0.0.155 vendor/activesupport-2.0.2-/lib/active_support/core_ext/array/random_access.rb
swivel-0.0.175 vendor/activesupport-2.0.2-/lib/active_support/core_ext/array/random_access.rb
swivel-0.0.156 vendor/activesupport-2.0.2-/lib/active_support/core_ext/array/random_access.rb
swivel-0.0.160 vendor/activesupport-2.0.2-/lib/active_support/core_ext/array/random_access.rb