[Nitro] Better than classinherit.rb!

TRANS transfire at gmail.com
Wed Apr 12 09:55:44 EDT 2006

On 4/12/06, zimba-tm <zimba.tm at gmail.com> wrote:
> What would be needed instead of redefining all the methods is toaccess directly to the singleton-class.
> Something like :
> class Module
>   def mixin(mod)    include mod    extend mod.singleton_class  end
> end
> et voila ! :-p (only the problem is that mod.singleton_class doesn't exist)


Actually if you think about it, why are "singleton classes" classes at
all? You can't instantiate them and you can't subclass them. So they
are more like modules in every way... well, except for how they are
tied into Ruby's inheritance tree.


More information about the Nitro-general mailing list