Is there a way to return a method parameter names in ruby

Posted by Martinos on Stack Overflow See other posts from Stack Overflow or by Martinos
Published on 2010-03-16T04:14:55Z Indexed on 2010/03/16 5:06 UTC
Read the original article Hit count: 293

Filed under:
|
|

Is it possible to get the parameter names of a method ?

Example with:

def method_called(arg1, arg2)
  puts my_method.inspect
end

I would like to know what method (my_method) should I call to get the following output:

["arg1", "arg2"]

© Stack Overflow or respective owner

Related posts about ruby

Related posts about parameters