# How can I listen the events of module/class defined

**URL:** <https://www.ruby-forum.com/t/how-can-i-listen-the-events-of-module-class-defined/156668>\
**Category:** Rails\
**Created:** [December 31, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/how-can-i-listen-the-events-of-module-class-defined/156668 "2008-12-31T17:30:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 31, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/how-can-i-listen-the-events-of-module-class-defined/156668/1 "2008-12-31T17:30:54Z")

</div>

In our project, I need to listen the events of module/class defined,  
and record the events that include the context of the module/class  
defined. In ruby, I cannot add a listener for the module/class  
defined, only i can set a proc with set\_trace\_func, in the proc, I  
cannot get the module/class name from the parameters.
