From: Sam Roberts Date: 2005-02-24T11:58:09+09:00 Subject: Re: surprising: class A; end; A === A ==> false Quoting jim@weirichhouse.org, on Thu, Feb 24, 2005 at 02:38:35AM +0900: > > Jamis Buck said: > > On 01:24 Thu 24 Feb , Sam Roberts wrote: > >> Is my only way: > [... code elided ...] > > case t.id > > when A.id then ... > > when B.id then ... > > end > > > > Still kind of kludgy, though. I think thats the best suggestion so far. > You could do ... > > class A > def do_something() ... end > end > class B > def do_something() ... end > end > > t.do_something I know where you are coming from, this is a nice pattern, but in this case t is a return value of Resolv::DNS::Message#question, and I have to answer the question. How I answer the question depends on the question (of course!), but is not part of the behaviour of the question, different "answers" answer the question in different ways. Thanks for all the suggestions, folks. Sam