From: Ken Mitchell Date: 2007-04-03T06:43:16+09:00 Subject: Re: Nested Modules/Classes Brian Candler wrote: > On Tue, Apr 03, 2007 at 06:02:41AM +0900, Ken Mitchell wrote: >> end >> ->test.rb:22: undefined local variable or method 'print_test' for >> Global:Class >> >> Whether "Global" is a Class or a Method the same happens. However, if I >> comment out "Global" completely, out put is as expected: >> >> ->test1 >> ->test2 > > If you 'include' a module in a class, its methods are added as instance > methods for objects of that class. Try: > > a = Global.new > a.print_test Thank you two! See, I knew it would be simple and now it even makes sense. So in the context of the above, my application will be performing a wide range of work and will need to be quite modular (ok I'm lazy). As far as preference and "best practice", how would I best layout the namespace. For instance: #/lib/testapp.rb #/lib/testapp/config.rb #/lib/testapp/logger.rb maybe this.... module Testapp module config end class logger end end Looking through included source, I see this done so many different ways. What is the best. Thanks so much -- Posted via http://www.ruby-forum.com/.