我希望我的模块的一部分扩展String类.
这不起作用
module MyModule class String def exclaim self << "!!!!!" end end end include MyModule string = "this is a string" string.exclaim #=> NoMethodError
但这样做
module MyModule def exclaim self << "!!!!!" end end class String include MyModule end string = "this is a string" string.exclaim #=> "this is a string!!!!!"