"=?UTF-8?B?RWluYXIgSMO4c3Q=?=" <ebuffer / delete.hotmail.com> writes:

> That solution requires some_field to be 'naturally' ordered, though,
> doesn't it? (I'm very new to Ruby...) What if some_field contains a
> string, and I want 'Oranges' to be sorted before 'Apples'? Actually,
> I'm writing a card game, so I want 'Spades' < 'Hearts' < 'Clubs' <
> 'Diamonds'.

arr.sort_by{|card| ~card.suit[0] & 0x1a}

;-)