Hey David,
bind *returns* a wrapped version of your original function: binding is
not a property of a function, it's something that is determined at
calling time.
You can either bind all responders at initialization, or just call them
with the proper binding each time.
Early binding:
for(responder in this.responders)
this.responders[responder] = this.responders[responder].bind(this);
On-the-fly bound calling, example for beforeLoad:
if (this.responders.beforeLoad)
this.responders.beforeLoad.call(this, arg1, arg2...);
'HTH
--
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---