鉴于此模块
module Test
def self.foo(v)
puts "Test.foo with #{v}"
end
end
以下不起作用
module Test
alias_method :bar, :foo
# ...
end
虽然它适用于实例方法。我收到以下错误
NameError: undefined method `foo' for module `Test'
我的目标是覆盖self.foo如下
def self.foo(v)
self.bar(v + " monkey patched")
end
有没有别名静态方法?
谢谢,