From: Christian Date: 2008-03-29T15:06:26+09:00 Subject: Re: Help on best way to gather/sort results ? ------=_Part_9728_32695547.1206770783386 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Or perhaps what you're really wanting, is something like @results.sort_by{|a| @results[1]}? On Sat, Mar 29, 2008 at 4:03 PM, Christian wrote: > Wouldn't you want something like @results.sort {|x, y| y[1] <=> x[1]}? > > > On Sat, Mar 29, 2008 at 3:49 PM, Tony De wrote: > > > Tony De wrote: > > > Todd Benson wrote: > > >> On Sat, Mar 29, 2008 at 12:02 AM, Tony De wrote: > > >>> have for qmail. So, I've got a working prototype. If you could > > help me > > >>> on my sort and if you have any other comments/suggestions to throw > > my > > >>> way I'm sure I could learn a thing or two. Being new to ruby, > > there's a > > >>> lot of new ideas here. Thank guys. > > >>> > > >> > > >> Being a little lazy at the moment to go through the code, have you > > >> looked at #sort_by{}? > > >> > > >> Todd > > > > > > I believe I ran across it but I recall it blew up when I worked with > > it. > > > Likely an issue with my as the unskilled ruby coder than the method > > > itself. I'll take another look. Thanks > > > > > > tonyd > > > > Ok, tried this @results.sort_by { |a| a[1] } - thinking that I want to > > sort on the second element in my array "Source". No sort was performed > > at all. Scratching my head.. > > > > tonyd > > -- > > Posted via http://www.ruby-forum.com/. > > > > > > > -- > > "Every child has many wishes. Some include a wallet, two chicks and a > cigar, but that's another story." > -- "Every child has many wishes. Some include a wallet, two chicks and a cigar, but that's another story." ------=_Part_9728_32695547.1206770783386--