From: "Brian Schröder" Date: 2005-02-24T02:47:39+09:00 Subject: Re: surprising: class A; end; A === A ==> false On Wed, 23 Feb 2005 18:44:20 +0100, Brian Schr�der wrote: > On Thu, 24 Feb 2005 02:38:35 +0900, Jim Weirich wrote: > > > > Jamis Buck said: > > > On 01:24 Thu 24 Feb , Sam Roberts wrote: > > >> Is my only way: > > [... code elided ...] > > >> or is there some clever workaround? > > > > > > You could do: > > > > > > case t.name > > > when "A" then ... > > > when "B" then ... > > > end > > > > > > or > > > > > > case t.id > > > when A.id then ... > > > when B.id then ... > > > end > > > > > > Still kind of kludgy, though. > > > > You could do ... > > > > class A > > def do_something() ... end > > end > > class B > > def do_something() ... end > > end > > > > t.do_something > > > Surprising, that the ruby way comes up at last. Quack ;) The above shall read: came up in the last message. I'm not shure if I haven't said something completely different. Sorry that I have to follow up my superfluous no-advice-message with another one correcting it. Think first, then type then think then send! Regards, Brian -- Brian Schr�der http://ruby.brian-schroeder.de/