Implemented a class listener

I'm coming from C# world and I worked in in-memory pub-sub framework, but I'm not an expert in ruby.
Sometimes the instances of listeners are not available and sometimes having these instances is useless and a waste of memory.
So I implemented a method to register a class as a listener so the publisher will create the instance only when necessary.
Don't know if you need it.
bye