Project

General

Profile

Bug #15481

Update NoMethodError/NameError docs

Added by zverok (Victor Shepelev) 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:90796]

Description

  • Add missing receiver: to NoMethodError.new;
  • Document receiver and private argument of NoMethodError.new;
  • Add explanations/examples about receiver to NameError.new;
  • Reformat both methods call-sequences in a modern way (KeyError.new already looks like this, so I took the liberty)

PS: In general, I believe that all method call-sequences should be, if possible, formatted in a "modern" way:

# bad:
new([msg, *, name [, args [, priv]]]) 
# good:
new(msg=nil, name=nil, args=nil, private=false, receiver: nil)

Some exceptions are, probably, legacy (pre-keyword-argument) methods with odd call-sequences, like Kernel#system which has optional FIRST argument, and described as:

system([env, ] command, ...)

Files

no-method-error-receiver.patch (1.63 KB) no-method-error-receiver.patch zverok (Victor Shepelev), 12/29/2018 10:21 AM

Associated revisions

Revision 2eee74ef
Added by nobu (Nobuyoshi Nakada) 7 months ago

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

Revision 66644
Added by nobu (Nobuyoshi Nakada) 7 months ago

Update NoMethodError/NameError docs [ci skip]

[ruby-core:90796] [Bug #15481]

From: zverok (Victor Shepelev) zverok.offline@gmail.com

History

#1

Updated by nobu (Nobuyoshi Nakada) 7 months ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66644.


Update NoMethodError/NameError docs [ci skip]

[ruby-core:90796] [Bug #15481]

From: zverok (Victor Shepelev) zverok.offline@gmail.com

Also available in: Atom PDF