Florian Groß
3/26/2007 12:54:00 PM
On 26 Mrz., 14:48, senthil <senthilku...@srishtisoft.com> 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.
Try this: employees.sort_by { |employee| [employee.salary,
employee.name] }
Kind regards,
Florian Gross