ruby-changes:72296
From: John <ko1@a...>
Date: Fri, 24 Jun 2022 05:51:08 +0900 (JST)
Subject: [ruby-changes:72296] 962a3247b1 (master): Correct documentation for protected methods [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=962a3247b1 From 962a3247b1b76770930200bcce7470a54dfb25c9 Mon Sep 17 00:00:00 2001 From: John Hawthorn <john@h...> Date: Fri, 11 Mar 2022 19:21:50 -0800 Subject: Correct documentation for protected methods [ci skip] --- doc/syntax/modules_and_classes.rdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/syntax/modules_and_classes.rdoc b/doc/syntax/modules_and_classes.rdoc index 6122f6e08e..9c83a319b9 100644 --- a/doc/syntax/modules_and_classes.rdoc +++ b/doc/syntax/modules_and_classes.rdoc @@ -155,8 +155,8 @@ Ruby has three types of visibility. The default is +public+. A public method https://github.com/ruby/ruby/blob/trunk/doc/syntax/modules_and_classes.rdoc#L155 may be called from any other object. The second visibility is +protected+. When calling a protected method the -sender must be a subclass of the receiver or the receiver must be a subclass of -the sender. Otherwise a NoMethodError will be raised. +receiver must inherit the Class or Module which defines the method. Otherwise a +NoMethodError will be raised. Protected visibility is most frequently used to define <code>==</code> and other comparison methods where the author does not wish to expose an object's -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/