2011/7/1 Josh Cheek <josh.cheek / gmail.com>: > 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, andt > 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 :) -- Iaki Baz Castillo <ibc / aliax.net>