From: "Brian Schröder" Date: 2005-02-24T02:44:34+09:00 Subject: Re: surprising: class A; end; A === A ==> false 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 ;) -- Brian Schr�der http://ruby.brian-schroeder.de/