Pairing Data 2-D array

I have class A.
I have a class B with attributes c and d.
A has many Bs.

I get an instance of A using
a = find_by…

I can get a listing (enumeration) of values for attribute b using map
function.{ |x| x.c}


However, I want c and d returned and paired together in an array like a
2-d array.

c1 d1
c2 d2
c3 c3

What’s the best way to do this? Map won’t work, correct?

You can do an array of arrays: {|x| [x.c, x.d]}

2014-04-14 18:12 GMT-03:00 Jan Yo [email protected]:{ |x| x.c}
c3 c3
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit

For more options, visit

Att, Antônio Augusto de Sousa Britto - 43ª turma de Ciência da
Computação -