From: MenTaLguY Date: 2007-03-26T21:54:43+09:00 Subject: Re: sorting an array basedon two attributes of objects On Mon, 26 Mar 2007 21:48:17 +0900, senthil wrote: > I want to sort the objects of array based on two attributes.I want > sort an employee class based on his salary and name , so that if two > person has same salary it should be sorted with name. Is this what you had in mind? sorted_employees = employees.sort_by { |e| [ e.salary, e.name ] } -mental