Ruby Namespaces / Modules

E

eastcoastcoder

If I'm in the middle of module A::B::C, and I want to reference a class
from A::B or from A::B::D, do I need to do ::A::B::Classname (or
::A::B::D::Classname)?

It seems a bit repititous to me. A module shouldn't need to know it's
ancestors all the way up - just what it needs to use. Having to keep
track couples modules to a tree and obstructs refactoring.

So, what say the veteran Rubyists?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top