From: Robert Klemme Date: 2005-11-16T19:37:18+09:00 Subject: Re: The subtleties of const_missing Nicholas Seckar wrote: > Hello all, > > I've run into an issue regarding the use of const_missing. This issue > revolves around the fact that these two cases are supposed to behave > differently from each other: > > irb(main):001:0> B = 10 > irb(main):002:0> module A; B; end > => 10 > irb(main):003:0> A::B > NameError: uninitialized constant A::B > from (irb):3 > > However it seems impossible to detect which case we are in within the > const_missing method. A more detailed explanation follows: I'm not sure what you're up to. You define B in a completely different scope than you use for lookup. Maybe you can give a more real life example of what you are actually trying to do. Kind regards robert