From: Raimon Fs Date: 2007-12-07T05:33:29+09:00 Subject: Re: array iterator that have more arrays that also need iter Raimon Fs wrote: > Xavier Noria wrote: >> On Dec 6, 2007, at 8:25 PM, Raimon Fs wrote: >> >>> I have one array, and each element of this array, has another array. >> >> >>> 700_tax: "17.91" >>> 82567.36 95778.21 13210.85 >>> 17.91 255.81 273.72 >>> 707.59 0.0 707.59 >> >> Looks like you have a collection of InvoicesCalcul, each of them with >> an accessor "attributes", which is a hash: >> >> values = invoice_calculs.map do |ic| >> ic.attributes >> end.map do |a| >> a.values >> end.flatten after reading some docs, it would be possible this: a.each_value {|value| puts value } but I'm getting this: 1600_base82567.36000000011600_value95778.211600_tax13210.85 and i want only the values, and it seems that puts in just one time all the key+values, not in a loop. debug(a) gives me: --- 1600_base: "82567.3600000001" 1600_value: "95778.21" 1600_tax: "13210.85" and in pseudo code, I want this: a.value for each value thanks again, raimon -- Posted via http://www.ruby-forum.com/.