Sha256: b8913db0de868a59f5e77a13e3864061028ae2425736cb80b690fd54741b8f8b
Contents?: true
Size: 209 Bytes
Versions: 28
Compression:
Stored size: 209 Bytes
Contents
class Array # # +choose+: choose a random element in the array # # returns a random element from the array # #:nodoc: def choose idx = (rand()*(self.size-1)).round self[idx] end end
Version data entries
28 entries across 28 versions & 1 rubygems