Ruby 2.0 Refinements in Practice

Posted . Visible to the public.

The first thing you need to understand is that the purpose of refinements in Ruby 2.0 is to make monkey-patching safer. Specifically, the goal is to make it possible to extend core classes, but to limit the effect of those extensions to a particular area of code. Since the purpose of this feature is make monkey-patching safer, let’s take a look at a dangerous case of monkey-patching and see how this new feature would improve the situation.

Last edit
Keywords
ruby, makandra
License
Source code in this card is licensed under the MIT License.
Posted by Lexy to makandra dev (2010-12-01 08:17)