From: Trans Date: 2005-08-17T04:36:14+09:00 Subject: Module.nesting -> Kernel#nesting I'm trying to write a little method called Module#modspace, which will return the module/class a module/class is defined in. I.e. Module X Module Y Module Z end end end X::Y::Z.modspace #=> X::Y So I thought, Module.nesting would help do the trick. But I discovered the Module.nesting returns the nesting according where it is called in the code, nothing more. It is like __LINE__ or __FILE__ in this respect. So it seems to me that it would be more appropriate to define #nesting in Kernel, not as a class method of Module. BTW, any help writing Module#modspace appreciated. T.