阅读背景:

猴子修补核心类的替代方案

来源:互联网 

I am still new to Ruby and basically just writing my first micro-program after finishing Cooper's book. I was pointed to the direction of avoiding monkey patching but the problem is I don't know what are the alternatives to achieve the same behavior. Basically, I want to add a new method that is accessible by every string object. The obvious monkey-patching way is to:I am still new to Ruby and basically just writi




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: