Sha256: 8a93a6d6022ab9d739973fa197a971fff49ecbfb051c5d9915f51ad5d19d73b6

Contents?: true

Size: 259 Bytes

Versions: 84

Compression:

Stored size: 259 Bytes

Contents

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

Version data entries

84 entries across 81 versions & 22 rubygems

Version Path
relevance-castronaut-0.7.4 vendor/activesupport/lib/active_support/core_ext/array/random_access.rb
relevance-castronaut-0.7.5 vendor/activesupport/lib/active_support/core_ext/array/random_access.rb
activesupport_csi-2.3.5.p8 lib/active_support/core_ext/array/random_access.rb
activesupport_csi-2.3.5.p7 lib/active_support/core_ext/array/random_access.rb
activesupport_csi-2.3.5.p6 lib/active_support/core_ext/array/random_access.rb
webroar-0.5.0 src/admin_panel/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiantcms-couchrest_model-0.2.4 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiantcms-couchrest_model-0.2.2 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiantcms-couchrest_model-0.2.1 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiantcms-couchrest_model-0.2 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiantcms-couchrest_model-0.1.9 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiantcms-couchrest_model-0.1.8 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiantcms-couchrest_model-0.1.7 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiantcms-couchrest_model-0.1.6 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiantcms-couchrest_model-0.1.5 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
radiant-0.7.2 vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
vibes-bj-1.2.2 spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
vibes-bj-1.2.1 spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
webroar-0.4.0 src/admin_panel/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb
nbudin-castronaut-0.7.5 vendor/activesupport/lib/active_support/core_ext/array/random_access.rb