From: Dave Thomas Date: 2001-11-23T04:09:34+09:00 Subject: [ruby-talk:26167] Re: Passing class names to constructors. Hugh Sasse Staff Elec Eng writes: > > mess << Class.new(knotclass) > > Can I do this if I have already defined class Knotclass? > The intention is to allow users to define their classes with > conventional subclassing, and then pass these subclasses into my > constructor. So I'm thinking that: > > > > Does the symbol buy you anything here? > > what it buys me is not doing Class.new(Knotclass) where Knotclass is > *already* defined. I thought you wanted to generate subclasses of KnotClass. If all you want to do is generate KnotClasses, then def whatever(klass = KnotClass) k = klass.new end Does the trick Dave