From: Giovanni Intini Date: 2005-08-07T19:22:45+09:00 Subject: Re: cartesian product if you want to create a new method for array just do class Array def cartprod(ary) result = [] self.each do |ae| ary.each do |be| result << [ae, be] end end result end end this way you can have an array and do new_array = source_array.cartprod(other_array)