aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/array/random_access.rb
blob: 343003f6f7c1340b0560236b0054fc2c9ea9b9f5 (plain) (tree)
1
2
3
4
5
6



                                            

     
class Array
  # Returns a random element from the array.
  def rand
    self[Kernel.rand(length)]
  end
end