Re:Kicking the Tires on Ruby 2.1 Preview
by ssmoot on Thursday September 26, 2013 @12:51PM
(#6451981)
You could always extend the singleton object before to avoid global monkey-patching.
But the real lesson is probably just if you're not writing ActiveSupport, don't do global monkey patches at all. Favor inheritance and composition. Especially in your own libraries where it's easier to ensure a global patch doesn't break your code.
But the real lesson is probably just if you're not writing ActiveSupport, don't do global monkey patches at all. Favor inheritance and composition. Especially in your own libraries where it's easier to ensure a global patch doesn't break your code.