1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add example for Method#parameters from [ruby-core:19759]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2016-02-09 18:43:45 +00:00
parent 70a4e9e7c8
commit 794eb48e00

12
proc.c
View file

@ -2390,6 +2390,18 @@ rb_method_location(VALUE method)
* meth.parameters -> array
*
* Returns the parameter information of this method.
*
* def foo(bar); end
* method(:foo).parameters #=> [[:req, :bar]]
*
* def foo(bar, baz, bat, &blk); end
* method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:req, :bat], [:block, :blk]]
*
* def foo(bar, *args); end
* method(:foo).parameters #=> [[:req, :bar], [:rest, :args]]
*
* def foo(bar, baz, *args, &blk); end
* method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:rest, :args], [:block, :blk]]
*/
static VALUE