From: "Iñaki Baz Castillo" Date: 2011-07-01T20:20:17+09:00 Subject: Re: How to order Structs based on two fields 2011/7/1 Josh Cheek : > Structs return classes already (this is why you can inherit from them in the > form `class A < Struct.new(:a,:b)`). You can pass Struct.new a block, and it > will be evaluated within the context of the struct you are creating: > > > KK = Struct.new(:a,:b) do >  def <=>(kk) >    if a < kk.a >      -1 >    elsif a > kk.a >      1 >    else >      kk.b <=> b >    end >  end > end Really thanks to all for your responses, I will try them :) -- Iñaki Baz Castillo