views:

79

answers:

2
+1  A: 

I think you may be trying to reinvent the wheel here. I would recommend using Observable instead. It's in the standard library, just require "observer" and include the Observable module into your class.

Bob Aman
yeah ive seen it, the problem is that it only allows you to observe one "event" (the status of the class). I want to be able to handle multiple events in one class
Jeivier
+1  A: 

Lol, ok i solved the problem... i wasnt calling listen_event correctly...

it should be listen_event(:indexChanged,method(:sayIndex)) not listen_event(:indexChanged,sayIndex(:index))

still learnin the ropes on ruby lol

Jeivier
Yes. I think I asked the original question. You just need to give the pointer to the event handler function (i think `listen_event(:indexChanged, :sayIndex` should work too)
Gishu