From: Daniel Cadenas Date: 2012-02-13T08:20:37+09:00 Subject: [ruby-core:42502] Re: Question on getting the receiver class information from a RUBY_EVENT_CALL event hook (1.9.2) On Sun, Feb 12, 2012 at 12:52 AM, Nobuyoshi Nakada wrote: > Hi, > > (12/02/12 4:26), Daniel Cadenas wrote: >> So, is there a way in which I can get the class where the >> RUBY_EVENT_CALL is ran instead of the class/module where it's defined? > > The receiver will be passed to the hook function as the 3rd argument, > So you can use rb_obj_class(). �Such dirty hack like real_class() is > never needed. �Also, use rb_class_real() if you want to get real class > from ICLASS/singleton class. > > -- > Nobu Nakada > Thanks a lot! that was just what I was needing