First page Back Continue Last page Overview Text


Another example of pointless restrictions that ruby places on you is that it only allows you to bind unbound methods to members of the same class.

Evilr adds a force_bind method that softens this restriction, allowing you to bind the method to any object that has the same internal type.

It does this by cloning the unbound method, modifying an internal class pointer in the clone's data structure to point to the class of the object you are attempting to bind the method to, and then calling bind on the clone.