From: Trans Date: 2008-10-23T11:44:54+09:00 Subject: Re: subclass a class in the namespace of the that subclass On Oct 22, 6:30 pm, "James Coglan" wrote: > >  class X < Y > >    class Y > >    end > >  end > > Could you make Y a module? > > class X >   module Y >     # methods >   end >   include Y >   # more methods > end > > Or, if Y needs to be a class: > > class X >   module M >     # methods for Y >   end >   class Y; include M; end # Y implements nothing itself >   include M >   # add methods to X here > end > > That way, X and Y both inherit from M, but Y is basically an empty class > that acts as an instantiable version of module M. That's probably the most justifiable approach under the circumstances (though lately I've been shying away a bit from modules[1]), most any other time I'd likely do that. But in this case, it just doesn't seem to fit. I have to name this module something (what?) and then I'll have to explain why it even exists, in the docs, and so on --it feels too "bolted on". I'll just have to think on it more. Thanks, T. [1] Yes, Austin I've learned a thing or two from you. :)