Module: ActiveSupport::CoreExtensions::Array::RandomAccess
- Included in:
- Array
- Defined in:
- lib/active_support/core_ext/array/random_access.rb
Instance Method Summary collapse
-
#rand ⇒ Object
This method is deprecated because it masks Kernel#rand within the Array class itself, which may be used by a 3rd party library extending Array in turn.
-
#random_element ⇒ Object
Returns a random element from the array.
Instance Method Details
#rand ⇒ Object
This method is deprecated because it masks Kernel#rand within the Array class itself, which may be used by a 3rd party library extending Array in turn. See
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4555
10 11 12 13 |
# File 'lib/active_support/core_ext/array/random_access.rb', line 10 def rand # :nodoc: ActiveSupport::Deprecation.warn 'Array#rand is deprecated and will be removed in Rails 3. Use "random_element" instead', caller random_element end |