From: Stefano Crocco Date: 2009-06-02T20:52:56+09:00 Subject: Re: Modules and importing them/their namespace? On Tuesday 02 June 2009, Markus Fischer wrote: > |Hi, > | > |I haven't found anything so far, so probably it doesn't exist and I'm > |thinking to much java-ish, but is there a way to import a namespace so I > |do not need long prefixes? > | > |Probably bad example, but if I would name > |MyModule::HasSubmodile::AndAnotherOne::FinallyMyClass , and I want to > |use it just like any other module, is there a way to import the > |"MyModule::HasSubmodile::AndAnotherOne" name and when I write > |FinallyMyClass.new it automatically resolves to the right one? > | > |thanks, > |- Markus Simply create a constant which points to the module: FinallyMyClass = MyModule::HasSubmodile::AndAnotherOne::FinallyMyClass With this you can do: obj = FinallyMyClass.new I hope this helps Stefano