Tutorial by Topics: patching

d3.dispatch - create a custom event dispatcher. dispatch.on - register or unregister an event listener. dispatch.copy - create a copy of a dispatcher. dispatch.call - dispatch an event to registered listeners. dispatch.apply - dispatch an event to registered listeners. Dispatching is a ...
Monkey Patching is a way of modifying and extending classes in Ruby. Basically, you can modify already defined classes in Ruby, adding new methods and even modifying previously defined methods. Monkey patching is often used to change the behavior of existing ruby code, from gems for instance. For...
Monkey patching, while convenient, has some pitfalls that aren't immediately obvious. Most notably, a patch like that in the example pollutes the global scope. If two modules both add Hash#symbolize, only the last module required actually applies its change; the rest are erased. Furthermore, if t...

Page 1 of 1