From 98c414a678c2497dc522abf3802b2f78bfc856c4 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 9 Jan 2026 17:48:27 -0500 Subject: [PATCH 1/4] [DOC] Improve docs for Module#> --- object.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/object.c b/object.c index 7dda2b6c0d49cd..c3128597762c12 100644 --- a/object.c +++ b/object.c @@ -2011,20 +2011,23 @@ rb_mod_ge(VALUE mod, VALUE arg) * call-seq: * self > other -> true, false, or nil * - * If +self+ is a class, returns +true+ if +self+ is a superclass of +other+, - * returns +false+ if +self+ is the same as +other+ or if +self+ is a subclass - * of +other+, and returns +nil+ if there are no relationship between the two: + * Returns +true+ if +self+ is an ancestor of +other+ + * (+self+ is a superclass of +other+ or +self+ is included in +other+): * - * Numeric > Float # => true - * Float > Numeric # => false - * Float > Float # => false - * Float > Hash # => nil + * Numeric > Float # => true + * Enumerable > Array # => true * - * If +self+ is a module, returns +true+ if +other+ includes +self+, - * returns +false+ if +self+ is the same as +other+ or if +self+ includes - * +other+, and returns +nil+ if there are no relationship between the two: + * Returns +false+ if +self+ is a descendant of +other+ + * (+self+ is a subclass of +other+ or +self+ includes +other+) or + * if +self+ is the same as +other+: * - * Enumerable > Array # => true + * Float > Numeric # => false + * Array > Enumerable # => false + * Float > Float # => false + * + * Returns +nil+ if there is no relationship between the two: + * + * Float > Hash # => nil * Enumerable > String # => nil * */ From 0b83346f1c1f6e54c344307c2ec5f9d0a6f80317 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 9 Jan 2026 17:54:22 -0500 Subject: [PATCH 2/4] [DOC] Improve docs for Module#< --- object.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/object.c b/object.c index c3128597762c12..8ec0dc50a6c25e 100644 --- a/object.c +++ b/object.c @@ -1967,13 +1967,24 @@ rb_class_inherited_p(VALUE mod, VALUE arg) * call-seq: * self < other -> true, false, or nil * - * Returns whether +self+ is a subclass of +other+, - * or +nil+ if there is no relationship between the two: + * Returns +true+ if +self+ is a descendant of +other+ + * (+self+ is a subclass of +other+ or +self+ includes +other+): * - * Float < Numeric # => true - * Numeric < Float # => false - * Float < Float # => false - * Float < Hash # => nil + * Float < Numeric # => true + * Array < Enumerable # => true + * + * Returns +false+ if +self+ is an ancestor of +other+ + * (+self+ is a superclass of +other+ or +self+ is included in +other+) or + * if +self+ is the same as +other+: + * + * Numeric < Float # => false + * Enumerable < Array # => false + * Float < Float # => false + * + * Returns +nil+ if there is no relationship between the two: + * + * Float < Hash # => nil + * Enumerable < String # => nil * */ From f0f4a683b4dddf870491607396a564dec55a4d6e Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 9 Jan 2026 17:56:47 -0500 Subject: [PATCH 3/4] [DOC] Improve docs for Module#<= --- object.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/object.c b/object.c index 8ec0dc50a6c25e..0238fefbfeb678 100644 --- a/object.c +++ b/object.c @@ -1915,11 +1915,24 @@ rb_mod_eqq(VALUE mod, VALUE arg) * call-seq: * mod <= other -> true, false, or nil * - * Returns true if mod is a subclass of other or - * is the same as other. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class A < B" implies "A < B".) + * Returns +true+ if +self+ is a descendant of +other+ + * (+self+ is a subclass of +other+ or +self+ includes +other+) or + * if +self+ is the same as +other+: + * + * Float <= Numeric # => true + * Array <= Enumerable # => true + * Float <= Float # => true + * + * Returns +false+ if +self+ is an ancestor of +other+ + * (+self+ is a superclass of +other+ or +self+ is included in +other+): + * + * Numeric <= Float # => false + * Enumerable <= Array # => false + * + * Returns +nil+ if there is no relationship between the two: + * + * Float <= Hash # => nil + * Enumerable <= String # => nil */ VALUE From 0d4538b57d5f835af27d8d29464c32dbdf4593f3 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 9 Jan 2026 18:00:27 -0500 Subject: [PATCH 4/4] [DOC] Improve docs for Module#>= --- object.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/object.c b/object.c index 0238fefbfeb678..75186a30c66868 100644 --- a/object.c +++ b/object.c @@ -2013,11 +2013,24 @@ rb_mod_lt(VALUE mod, VALUE arg) * call-seq: * mod >= other -> true, false, or nil * - * Returns true if mod is an ancestor of other, or the - * two modules are the same. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class A < B" implies "B > A".) + * Returns +true+ if +self+ is an ancestor of +other+ + * (+self+ is a superclass of +other+ or +self+ is included in +other+) or + * if +self+ is the same as +other+: + * + * Numeric >= Float # => true + * Enumerable >= Array # => true + * Float >= Float # => true + * + * Returns +false+ if +self+ is a descendant of +other+ + * (+self+ is a subclass of +other+ or +self+ includes +other+): + * + * Float >= Numeric # => false + * Array >= Enumerable # => false + * + * Returns +nil+ if there is no relationship between the two: + * + * Float >= Hash # => nil + * Enumerable >= String # => nil * */