mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update NoMethodError/NameError docs [ci skip]
[ruby-core:90796] [Bug #15481] From: zverok (Victor Shepelev) <zverok.offline@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
65b1cf0e82
commit
2eee74ef54
1 changed files with 13 additions and 4 deletions
17
error.c
17
error.c
|
@ -1451,12 +1451,15 @@ name_err_init_attr(VALUE exc, VALUE recv, VALUE method)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* NameError.new(msg [, name]) -> name_error
|
* NameError.new(msg=nil, name=nil, receiver: nil) -> name_error
|
||||||
* NameError.new(msg [, name], receiver:) -> name_error
|
|
||||||
*
|
*
|
||||||
* Construct a new NameError exception. If given the <i>name</i>
|
* Construct a new NameError exception. If given the <i>name</i>
|
||||||
* parameter may subsequently be examined using the <code>NameError#name</code>
|
* parameter may subsequently be examined using the <code>NameError#name</code>
|
||||||
* method.
|
* method. <i>receiver</i> parameter allows to pass object in
|
||||||
|
* context of which the error happened. Example:
|
||||||
|
*
|
||||||
|
* [1, 2, 3].method(:rject) # NameError with name "rject" and receiver: Array
|
||||||
|
* [1, 2, 3].singleton_method(:rject) # NameError with name "rject" and receiver: [1, 2, 3]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -1535,12 +1538,18 @@ nometh_err_init_attr(VALUE exc, VALUE args, int priv)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* NoMethodError.new([msg, *, name [, args [, priv]]]) -> no_method_error
|
* NoMethodError.new(msg=nil, name=nil, args=nil, private=false, receiver: nil) -> no_method_error
|
||||||
*
|
*
|
||||||
* Construct a NoMethodError exception for a method of the given name
|
* Construct a NoMethodError exception for a method of the given name
|
||||||
* called with the given arguments. The name may be accessed using
|
* called with the given arguments. The name may be accessed using
|
||||||
* the <code>#name</code> method on the resulting object, and the
|
* the <code>#name</code> method on the resulting object, and the
|
||||||
* arguments using the <code>#args</code> method.
|
* arguments using the <code>#args</code> method.
|
||||||
|
*
|
||||||
|
* If <i>private</i> argument were passed, it designates method was
|
||||||
|
* attempted to call in private context, and can be accessed with
|
||||||
|
* <code>#private_call?</code> method.
|
||||||
|
*
|
||||||
|
* <i>receiver</i> argument stores an object whose method was called.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
Loading…
Reference in a new issue