Sha256: f2b64640122a0dafd177923ad01f7bd255c24935aafde77fcca02bd465f3b1e5

Contents?: true

Size: 219 Bytes

Versions: 5

Compression:

Stored size: 219 Bytes

Contents

module EnumerableExtensions
  def cart_prod( *args )
    args.inject([[]]){|old,lst|
      new = []
      lst.each{|e| new += old.map{|c| c.dup << e }}
      new
    }
  end
end

Enumerable.extend(EnumerableExtensions)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
egor-0.0.1 lib/enumerable_extensions.rb
egor-0.0.2 lib/enumerable_extensions.rb
egor-0.0.4 lib/enumerable_extensions.rb
egor-0.0.3 lib/enumerable_extensions.rb
egor-0.0.5 lib/enumerable_extensions.rb