Hacker News new | ask | show | jobs
by Lammy 2041 days ago
> Include and Extend your Classes

And — since Ruby 2.0 — Module#prepend, which places the prepended Module ahead of the caller in the ancestor chain https://ruby-doc.org/core/Module.html#method-i-prepend

1 comments

Which is a much nicer alternative to `alias_method_chain` and similar for monkey-patching or enhancing an existing method in a class as it makes more clear the existence and origin of the patch.