From: "Iñaki Baz Castillo" Date: 2011-07-01T21:45:21+09:00 Subject: Re: How to order Structs based on two fields 2011/7/1 Rob Biedenharn : > Actually, there's a method to help with exactly this sort of thing (pun > intended). > > def <=>(o) >  (a <=> o.a).nonzero? || b <=> o.b > end > > Take a look at Numeric#nonzero? and you'll find an example that's almost > exactly this. Very cool :) -- Iñaki Baz Castillo