From: Brian Candler Date: 2010-08-07T17:27:14+09:00 Subject: Re: class definition outside module Rajarshi Chakravarty wrote: > Hi, > I have 2 classes, Parser and Util in parser.rb and util.rb respectively. > Each has a lot of methods. > I want to put them both inside one module but keep the class definition > in separate files. > So basically there will be 3 files now: mod.rb (that will have the > module) and the 2 files mentioned above. Conventionally you would organise this as: --- lib/mod/parser.rb module Mod class Parser ... end end --- lib/mod/util.rb module Mod class Util ... end end Then, if you wish, you can add: --- lib/mod.rb require 'mod/parser' require 'mod/util' -- Posted via http://www.ruby-forum.com/.