Skip to content

Commit 0d4538b

Browse files
committed
[DOC] Improve docs for Module#>=
1 parent f0f4a68 commit 0d4538b

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

object.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,11 +2013,24 @@ rb_mod_lt(VALUE mod, VALUE arg)
20132013
* call-seq:
20142014
* mod >= other -> true, false, or nil
20152015
*
2016-
* Returns true if <i>mod</i> is an ancestor of <i>other</i>, or the
2017-
* two modules are the same. Returns
2018-
* <code>nil</code> if there's no relationship between the two.
2019-
* (Think of the relationship in terms of the class definition:
2020-
* "class A < B" implies "B > A".)
2016+
* Returns +true+ if +self+ is an ancestor of +other+
2017+
* (+self+ is a superclass of +other+ or +self+ is included in +other+) or
2018+
* if +self+ is the same as +other+:
2019+
*
2020+
* Numeric >= Float # => true
2021+
* Enumerable >= Array # => true
2022+
* Float >= Float # => true
2023+
*
2024+
* Returns +false+ if +self+ is a descendant of +other+
2025+
* (+self+ is a subclass of +other+ or +self+ includes +other+):
2026+
*
2027+
* Float >= Numeric # => false
2028+
* Array >= Enumerable # => false
2029+
*
2030+
* Returns +nil+ if there is no relationship between the two:
2031+
*
2032+
* Float >= Hash # => nil
2033+
* Enumerable >= String # => nil
20212034
*
20222035
*/
20232036

0 commit comments

Comments
 (0)