我有一个看起来像的方法
def SomeMethod (*args)
m = if args.length > 0 then
self.method(:method1)
else
self.method(:method2)
end
m.call ... #need to either pipe all arguments aside from the first
#and in other cases substitute the first argument
end
实际结构稍微复杂一点,其中要调用的方法来自不同的实例,在某些情况下,我必须通过管道传输所有参数,以免第一个参数,在其他情况下,我必须用另一个值替换第一个参数