diff options
| author | BurdetteLamar <burdettelamar@yahoo.com> | 2025-12-20 00:19:54 +0000 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2025-12-19 21:36:46 -0500 |
| commit | b7d4d7c911e1aa3882b1186ba0ba780801ab27ea (patch) | |
| tree | ce7aaacd296bb59cd8efa10515376b568f48facd /string.c | |
| parent | bb0637a92f94dc0aa00e7dd8de4455bb23204068 (diff) | |
[DOC] Harmonize several <=> methods
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -12374,18 +12374,24 @@ sym_succ(VALUE sym) /* * call-seq: - * symbol <=> object -> -1, 0, +1, or nil + * self <=> other -> -1, 0, 1, or nil + * + * Compares +self+ and +other+, using String#<=>. * - * If +object+ is a symbol, - * returns the equivalent of <tt>symbol.to_s <=> object.to_s</tt>: + * Returns: * - * :bar <=> :foo # => -1 - * :foo <=> :foo # => 0 - * :foo <=> :bar # => 1 + * - <tt>symbol.to_s <=> other.to_s</tt>, if +other+ is a symbol. + * - +nil+, otherwise. + * + * Examples: * - * Otherwise, returns +nil+: + * :bar <=> :foo # => -1 + * :foo <=> :foo # => 0 + * :foo <=> :bar # => 1 + * :foo <=> 'bar' # => nil * - * :foo <=> 'bar' # => nil + * \Class \Symbol includes module Comparable, + * each of whose methods uses Symbol#<=> for comparison. * * Related: String#<=>. */ |
