Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 67 additions & 27 deletions object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1915,11 +1915,24 @@ rb_mod_eqq(VALUE mod, VALUE arg)
* call-seq:
* mod <= other -> true, false, or nil
*
* Returns true if <i>mod</i> is a subclass of <i>other</i> or
* is the same as <i>other</i>. Returns
* <code>nil</code> 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
Expand Down Expand Up @@ -1967,13 +1980,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
* 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 < Numeric # => true
* Numeric < Float # => false
* Float < Float # => false
* Float < Hash # => nil
* Float < Hash # => nil
* Enumerable < String # => nil
*
*/

Expand All @@ -1989,11 +2013,24 @@ rb_mod_lt(VALUE mod, VALUE arg)
* call-seq:
* mod >= other -> true, false, or nil
*
* Returns true if <i>mod</i> is an ancestor of <i>other</i>, or the
* two modules are the same. Returns
* <code>nil</code> 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
*
*/

Expand All @@ -2011,20 +2048,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
*
*/
Expand Down