From: Ruby Rabbit Date: 2009-01-14T18:33:04+09:00 Subject: Re: Implementing each and <=> Brian Candler wrote: > Ruby Rabbit wrote: >> def <=>(other) >> @list <=> other >> end > > Perhaps you mean something like this: > > include Comparable > def <=>(other) > @list <=> other.list # or some other way to order them > end > > Making your objects Comparable is distinct from making them Enumerable. I was thinking that including Comparable would give users the ability to sort the existing model in various ways. I was wrong there, since it clearly is a comparison with another model. That is not something likely. My bad. Thanks, Brian. -- Posted via http://www.ruby-forum.com/.