有谁知道Ruby的要求,告诉我如果以下是有效的语法:
class Something def initialize(mode) case mode when :one then require 'some_gem' when :two then require 'other_gem' end end end s = Something.new
如果是这样,需要将gem放在全局命名空间中,就像在文件顶部一样?
解决方法
If so,would the require place the gem
into the global namespace as the same
require at the top of the file would?
是.要求没有范围,而负载.