如何在ruby中完成http://php.net/manual/en/function.call-user-func-array.php?在Ruby中實現`call_user_func_array`
所以我可以這樣做:
class App
def foo(a,b)
puts a + b
end
def bar
args = [1,2]
App.send(:foo, args) # doesn't work
App.send(:foo, args[0], args[1]) # does work, but does not scale
end
end
因爲這不是一個PHP的問題。 – 2011-02-25 15:57:05