From: Robert Feldt Date: 2001-11-22T19:51:21+09:00 Subject: [ruby-talk:26127] Re: Dynamic programming and Unit Testing. On Thu, 22 Nov 2001, Hugh Sasse Staff Elec Eng wrote: Sorry for not replying to all of your mail, but at least: > However, one cannot define a class in a method. This presumably relates > Well, you can sort of do it: class T def sub cls = Class.new(T) cls.class_eval %{ def sub puts "No more! Already in subclass." end } cls end end SubT = T.new.sub st = SubT.new st.sub #=> "No more! Already in subclass." Maybe you can adapt this for your problem? Or am I out of line? /Robert