Sha256: db8940f6cb99cb8a8b5dc4f27941587dd6256c8b4048985d017c551b4e39c5f7

Contents?: true

Size: 147 Bytes

Versions: 18

Compression:

Stored size: 147 Bytes

Contents

class Array
  def random
    self[Kernel.rand(size)]
  end

  def random_subset(len=2)
    rs = []
    len.times { rs << random }
    rs
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
sevenwire-forgery-0.1.0 lib/extensions/array.rb
sevenwire-forgery-0.2.0 lib/extensions/array.rb
sevenwire-forgery-0.2.1 lib/extensions/array.rb
sevenwire-forgery-0.2.2 lib/extensions/array.rb
forgery-0.3.12 lib/forgery/extensions/array.rb
forgery-0.3.11 lib/forgery/extensions/array.rb
forgery-0.3.10 lib/forgery/extensions/array.rb
forgery-0.3.9 lib/forgery/extensions/array.rb
forgery-0.3.8 lib/forgery/extensions/array.rb
forgery-0.3.7 lib/forgery/extensions/array.rb
forgery-0.3.6 lib/forgery/extensions/array.rb
forgery-0.3.5 lib/forgery/extensions/array.rb
forgery-0.3.4 lib/forgery/extensions/array.rb
forgery-0.3.3 lib/forgery/extensions/array.rb
forgery-0.3.2 lib/forgery/extensions/array.rb
forgery-0.3.1 lib/forgery/extensions/array.rb
forgery-0.3.0 lib/forgery/extensions/array.rb
forgery-0.2.2 lib/extensions/array.rb