鉴于以下Ruby 2.x方法,我如何检查关键字参数?
def for_account(token_id: nil, email: nil, password: nil)
puts "arguments are: ??"
end
答案 0 :(得分:1)
def for_account(token_id: nil, email: nil, password: nil)
puts "arguments are: ??"
end
p method(:for_account).parameter
# => [[:key, :token_id], [:key, :email], [:key, :password]]