Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (15 sloc) 223 Bytes
class CartesianProduct
include Enumerable
attr_accessor :a, :b
def initialize(a, b)
@a = a
@b = b
end
def each
@a.each do |a|
@b.each do |b|
yield [a,b]
end
end
end
end