[LRUG] Ruby Cluetrain

Tim Cowlishaw tim at timcowlishaw.co.uk
Mon Oct 26 07:36:11 PDT 2009


On 26 Oct 2009, at 14:20, James Adam wrote:

> With reference to the actual FreeAgent example, the reason why I  
> can't do "Mod::Child" is because I don't know the name of the module  
> that "Child" (or "Contact") is going to rest in; it could be  
> CompanyOne::Contact, or CompanyTwo::Contact, or BlahCorp::Contact.  
> The way that we know it's "Mod::Child" in that example is an  
> artefact of the simplification, unfortunately.

Aha! ok, that makes sense. I'd be interested to see how you got around  
that - short of manually building some sort of lookup graph of your  
app's module space as you define new modules, I can't think of a way  
around it. Had been considering Class#ancestors and Class#constants,  
but those (I think) reflect inheritance heirarchy, rather the  
heirarchy of scopes in which they're defined.

Cheers,

Tim




More information about the Chat mailing list