From: Bernhard Weitzhofer Date: 2003-05-13T23:12:33+09:00 Subject: Scope of modules and classes Hello Ruby-community I am writing a set of classes to be used in a mod_ruby environment, and I decided to group them together in a module: module M class K1 end class K2 end ... end Now I am about to write a module M2, that uses some of the classes of module M: module M2 class K3 < M::K1 def initialize @a = M::K2.new @b = M::K2.new end end ... end So far so good - but then I wanted to get rid of all those "M::"s: module M2 include M class K3 < K1 def initialize @a = K2.new @b = K2.new end end ... end does not work (K2 is unknown in the scope of K3), and: module M2 class K3 < M::K1 include M def initialize @a = K2.new @b = K2.new end end ... end seems a little bit ugly to me since I have to include M in every class of M2 Is there a better way, should I stick to the "M::"s, or is it just bad design that I am doing here? Thanks in advance, Bernhard Weitzhofer