aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-02 01:55:33 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-02 01:55:33 +0000
commit9b7b44168759ef764b60d9d297007958058694ee (patch)
treef78222590d810e7d40acde8fb783810d71066684 /proc.c
parent04042ec6eb45a5fd4913cdf2b9893e81e1ca2d75 (diff)
downloadruby-9b7b44168759ef764b60d9d297007958058694ee.tar.gz
* proc.c: Modify rdoc of Proc#arity to fit with current behavior.
See #5694 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/proc.c b/proc.c
index de04f6d441..7a4131e17e 100644
--- a/proc.c
+++ b/proc.c
@@ -839,11 +839,14 @@ rb_proc_call_with_block(VALUE self, int argc, const VALUE *argv, VALUE pass_proc
* call-seq:
* prc.arity -> fixnum
*
- * Returns the number of arguments that would not be ignored. If the block
+ * Returns the number of mandatory arguments. If the block
* is declared to take no arguments, returns 0. If the block is known
- * to take exactly n arguments, returns n. If the block has optional
- * arguments, return -n-1, where n is the number of mandatory
- * arguments. A <code>proc</code> with no argument declarations
+ * to take exactly n arguments, returns n.
+ * If the block has optional arguments, returns -n-1, where n is the
+ * number of mandatory arguments, with the exception for blocks that
+ * are not lambdas and have only a finite number of optional arguments;
+ * in this latter case, returns n.
+ * A <code>proc</code> with no argument declarations
* is the same a block declaring <code>||</code> as its arguments.
*
* proc {}.arity #=> 0