Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Module#>
(::Module other) -> bool?
self > other → true, false, or nil
object.c
View on GitHub ↗
static VALUE
rb_mod_gt(VALUE mod, VALUE arg)
{
if (mod == arg) return Qfalse;
return rb_mod_ge(mod, arg);
}
Returns true if self is an ancestor of other (self is a superclass of other or self is included in other):
Example
Numeric > Float # => true Enumerable > Array # => true
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:
Example
Float > Numeric # => false Array > Enumerable # => false Float > Float # => false
Returns nil if there is no relationship between the two:
Example
Float > Hash # => nil Enumerable > String # => nil