2 ms·
With refinements, there is now little excuse to do that globally in Ruby any more. Refinements let you "temporarily" modify a class within a lexical scope. E.g
by vidarh 2y ago
With refinements, there is now little excuse to do that globally in Ruby any more.
Refinements let you "temporarily" modify a class within a lexical scope. E.g I have an experimental parser generator that heavily monkeypatches core classes, but only when lexically inside the grammar definition.
It lets you have the upsides of the footguns, but keeping them tightly controlled.