You can use product to get the cartesian product of the arrays first, then collect the function results.
a.product(b) => [[1, 3], [1, 4], [2, 3], [2, 4]]
So you can use map or collect to get the results. They are different names for the same method.
a.product(b).collect { |x, y| f(x, y) }