[DOC] Addition to section 'Related Methods' (#6271)

Addition to section 'Related Methods':  suggests adding differentiators to the names of related methods.
This commit is contained in:
Burdette Lamar 2022-08-22 13:17:05 -05:00 committed by GitHub
parent a9ee13365a
commit aeac8b6c3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2022-08-23 03:17:33 +09:00
Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>

View File

@ -376,12 +376,22 @@ Mention aliases in the form
In some cases, it is useful to document which methods are related to In some cases, it is useful to document which methods are related to
the current method. For example, documentation for `Hash#[]` might the current method. For example, documentation for `Hash#[]` might
mention `Hash#fetch` as a related method, and `Hash#merge` might mention mention `Hash#fetch` as a related method, and `Hash#merge` might mention
`Hash#merge!` as a related method. Consider which methods may be related `Hash#merge!` as a related method.
to the current method, and if you think the reader would benefit it,
at the end of the method documentation, add a line starting with - Consider which methods may be related
"Related: " (e.g. "Related: #fetch"). Don't list more than three to the current method, and if you think the reader would benefit it,
related methods. If you think more than three methods are related, at the end of the method documentation, add a line starting with
pick the three you think are most important and list those three. "Related: " (e.g. "Related: #fetch.").
- Don't list more than three related methods.
If you think more than three methods are related,
list the three you think are most important.
- Consider adding:
- A phrase suggesting how the related method is similar to,
or different from,the current method.
See an example at Time#getutc.
- Example code that illustrates the similarities and differences.
See examples at Time#ctime, Time#inspect, Time#to_s.
### Methods Accepting Multiple Argument Types ### Methods Accepting Multiple Argument Types