aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-09 18:43:45 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-09 18:43:45 +0000
commit9e3187d78ae661296bd43382ec835dd75bc22bf6 (patch)
tree5fa46c33096cb82c8d9e367cbb33ea87700858f1 /proc.c
parent5c5a308ef7810988f69a7844387a524155c040ca (diff)
downloadruby-9e3187d78ae661296bd43382ec835dd75bc22bf6.tar.gz
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
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 789995affd..6155dc0d35 100644
--- a/proc.c
+++ b/proc.c
@@ -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