From: zverok.offline@... Date: 2018-12-29T10:23:06+00:00 Subject: [ruby-core:90796] [Ruby trunk Bug#15481] Update NoMethodError/NameError docs Issue #15481 has been reported by zverok (Victor Shepelev). ---------------------------------------- Bug #15481: Update NoMethodError/NameError docs https://bugs.ruby-lang.org/issues/15481 * Author: zverok (Victor Shepelev) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- * 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) -- https://bugs.ruby-lang.org/ Unsubscribe: