阅读背景:

如何在Ruby中改进模块方法?

来源:互联网 

You can refine your class with

你可以改进你的课程

module RefinedString
  refine String do
    def to_boolean(text)
    !!(text =~ /^(true|t|yes|y|1)$/i)
    end
  end
end
m



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

分享到: