From 0d4538b57d5f835af27d8d29464c32dbdf4593f3 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 9 Jan 2026 18:00:27 -0500 Subject: [PATCH] [DOC] Improve docs for Module#>= --- object.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/object.c b/object.c index 0238fefbfe..75186a30c6 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 * */