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 -- -- Jim Weirich jim / weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)