Ruby和ROR的新手并且每天都喜欢它,所以这是我的问题,因为我不知道如何谷歌它(我已经尝试:))
我们有方法
def foo(first_name, last_name, age, sex, is_plumber)
# some code
# error happens here
logger.error "Method has failed, here are all method arguments #{SOMETHING}"
end
Run Code Online (Sandbox Code Playgroud)
所以我正在寻找方法将所有参数传递给方法,而不列出每一个.因为这是Ruby我假设有一种方式:)如果它是java我会列出它们:)
输出将是:
Method has failed, here are all method arguments {"Mario", "Super", 40, true, true}
Run Code Online (Sandbox Code Playgroud)