summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2026-01-06 16:13:15 -0600
committerGitHub <noreply@github.com>2026-01-06 17:13:15 -0500
commit58fb95af36c86b00b134db5275becf7455ba4790 (patch)
tree36ceb4e9803a78fd645fd73c704a7b22674aaa28 /object.c
parent49ca241d6d5f589dec8f42fecdc8ecb96690b859 (diff)
[DOC] Harmonize #== methods (#15805)
Diffstat (limited to 'object.c')
-rw-r--r--object.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/object.c b/object.c
index ed7e0ff224..2b3535158f 100644
--- a/object.c
+++ b/object.c
@@ -200,14 +200,18 @@ rb_eql(VALUE obj1, VALUE obj2)
/**
* call-seq:
- * obj == other -> true or false
- * obj.equal?(other) -> true or false
- * obj.eql?(other) -> true or false
- *
- * Equality --- At the Object level, #== returns <code>true</code>
- * only if +obj+ and +other+ are the same object. Typically, this
- * method is overridden in descendant classes to provide
- * class-specific meaning.
+ * self == other -> true or false
+ * equal?(other) -> true or false
+ * eql?(other) -> true or false
+ *
+ * Returns whether +self+ and +other+ are the same object:
+ *
+ * object = Object.new
+ * object == object # => true
+ * object == Object.new # => false
+ *
+ * Here in class \Object, #==, #equal?, and #eql? are the same method.
+ * A subclass may override #== to provide class-specific meaning.
*
* Unlike #==, the #equal? method should never be overridden by
* subclasses as it is used to determine object identity (that is,