From 962a3247b1b76770930200bcce7470a54dfb25c9 Mon Sep 17 00:00:00 2001 From: John Hawthorn 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(-) (limited to 'doc') 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 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 == and other comparison methods where the author does not wish to expose an object's -- cgit v1.2.3