From: Raimon Fs Date: 2007-12-07T18:22:40+09:00 Subject: Re: array iterator that have more arrays that also need iter Jordan Callicoat wrote: > On Dec 7, 2:06 am, Raimon Fs wrote: >> > with tha variable "values" which is assigned the result of the >> when I issue the sql: >> attributes: >> base: "707.59" >> Posted viahttp://www.ruby-forum.com/. > Hashes are unordered in ruby 1.8. The best way to guarantee you always > get the order you expect is to sort the keys. Using Xavier's code from > above with "values" result sorted on hash key... > > values = @arr[0].map do |ic| > ic.attributes > end.map do |a| > a.keys.sort.map do |k| # this part > a[k] > end > end.flatten > > Regards, > Jordan thanks for the explanation, I see I have to learn more Ruby ... :-) regards, raimon -- Posted via http://www.ruby-forum.com/.