From: Ilias Lazaridis Date: 2011-05-27T13:55:25+09:00 Subject: Re: CORE - Object Instantiation and Location On 26 Μάϊος, 13:31, Roger Braun wrote: > 2011/5/26 Ilias Lazaridis : > > > > > What I'm looking for: > > > how can I detect WHERE the object was instantiated? > > This seems to do what you need. > > http://snippets.dzone.com/posts/show/2787 > > See also here: > > http://www.ruby-doc.org/core/classes/Kernel.html#M001397 This one could lead to a solution, at least a temporal one. I can retrieve from the Kernel.caller the call stack, and from there the information
. How can I user the string "
" or "" to retrieve the actual object of main or MyClass? . -- http://lazaridis.com