From: Raimon Fs Date: 2007-12-07T08:13:19+09:00 Subject: Re: array iterator that have more arrays that also need iter Xavier Noria wrote: > On Dec 6, 2007, at 11:33 PM, Raimon Fs wrote: > >> ... >> 82567.36 >> 95778.21 >> 13210.85 >> >> I hope it's more clear what I'm trying to do now ... > > The version with flatten gives you all the values in a row in a single > array. From the YAML dump that would be > > ["82567.36", 95778.21", "13210.85", "17.91", "255.81", "273.72", ...] > > The version without flatten gives an array of arrays. Each array > element contains the values corresponding to a single InvoicesCalcul: > > [["82567.36", 95778.21", "13210.85"], ["17.91", "255.81", > "273.72"], ...] > > Please use that array notation to indicate how would the desired > result look like if it is none of those. > > -- fxn I must be missing something, because if I make a debug(a): values = @arr[0].map do |ic| ic.attributes end.map do |a| # a.values debug(a) end.flatten 1600_base: "82567.3600000001" 1600_value: "95778.21" 1600_tax: "13210.85" I'm still getting attributes and values, not a simple array ... I'm going to re-check all the code and see where the problem is ... thanks! r. -- Posted via http://www.ruby-forum.com/.