mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Correct documentation for protected methods [ci skip]
This commit is contained in:
parent
b180ffa622
commit
962a3247b1
1 changed files with 2 additions and 2 deletions
|
@ -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 <code>==</code> and
|
||||
other comparison methods where the author does not wish to expose an object's
|
||||
|
|
Loading…
Reference in a new issue