From: Eero Saynatkari Date: 2006-08-29T23:47:52+09:00 Subject: Re: Extending class from other module Alexander Rysenko wrote: > 1st question: If I got it right, modules in Ruby can be used as > namespaces. Is it ok? Is there some other (preffered) way? That is the way to do it. > 2nd question: I need to extend some class from one module in another > one. Basically I do something like this: > > module Mod1 > class A1 > end > > class B2 < Mod2::B1 > end > end > > module Mod2 > class B1 > end > end > > But this doesn't really work (seems like B1 isn't really found). How can > I do such a thing? You need to flip those around. You cannot inherit from Mod2::B1 before it is defined. -- Posted via http://www.ruby-forum.com/.