summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/string.c b/string.c
index b11b441ac5..83219d1a26 100644
--- a/string.c
+++ b/string.c
@@ -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#<=>.
*/