From: Joel VanderWerf Date: 2003-03-18T03:57:34+09:00 Subject: Re: Is there a ruby equivalent of "using" to help with namespaces? Sam Roberts wrote: > I've: > > module Rfc2425 > class DirectoryInfo > class Field > end > end > end > > But doing Rfc2425::DirectoryInfo::Field.new is a little much. So much, > that I'm considering reorganizing things so that the line is shorter. > Perhaps rename DirectoryInfo to "Base", maybe move Field back into > Rfc2425. > > But... the way it is now is Right, why should I rearrange it to solve > an ease-of-use problem? > > Is there another way, maybe that would allow: > > using Rfc2425::DirectoryInfo::Field > > Field.new Field = Rfc2425::DirectoryInfo::Field Field.new You might want to wrap the above 2 lines in a module, so as not to define Field globally.