Monkey patch

A monkey patch is a way to extend or modify the run-time code of dynamic languages without altering the original source code. This process has also been termed duck punching and shaking the bag.

The term monkey patch seems to have come from an earlier term, guerrilla patch,[2] which referred to changing code sneakily at runtime.

In Ruby, Python,and many other dynamic programming languages, the term monkey patch only refers to dynamic modifications of a class or module at runtime, motivated by the intent to patch existing third-party code as a workaround to a bug or feature which does not act as desired.

  • define a class method inside a class has defined already.

http://metalelf0dev.blogspot.com/2010/04/ruby-mixin-and-monkey-patching-examples.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s