
The term "monkey patching" describes injecting additional methods into a class whose implementation you don't control. if done without care, this is dangerous; the problematic case arises when:
* you add a method to a class;
* a newer version of the monkey-patched class adds another method of
the same name
* and uses that new method in some other part of its own
implementation.
ex::monkeypatched lets you do this sort of monkey-patching safely: before it injects a method into the target class, it checks whether the class already has a method of the same name. if it finds such a method, it throws an exception (at compile-time with respect to the code that does the injection).
see
for more details.