Note on Responsible Monkeypatching in Ruby | AppSignal Blog via blog.appsignal.com
Instead, it’s much better to wrap your patch in a module and apply it using Module#prepend. Doing so leaves you free to call the original implementation, and a quick call to Module#ancestors will show the patch in the inheritance hierarchy so it’s easier to find if things go wrong.
Finally, a simple prepend statement is easy to comment out if you need to disable the patch for some reason.
Reference
- Notes
- language-ruby, software
- Responsible Monkeypatching in Ruby | AppSignal Blog
-
Permalink to
2021.NTE.054
- Insight
- Edit
← Previous | Next → |
Note on Bobos in Ikea - By Brandon - Sweater Weather via blgtylr.substack.com | Note on Why I Hate the Phrase “Breaking Down Silos” – charity.wtf via charity.wtf |