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”).
/*
* call-seq:
* mod <= other => true, false, or nil
*
* Returns true if <i>mod</i>isasubclassof<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").
*
*/VALUErb_class_inherited_p(mod,arg)VALUEmod,arg;{VALUEstart=mod;if(mod==arg)returnQtrue;switch(TYPE(arg)){caseT_MODULE:caseT_CLASS:break;default:rb_raise(rb_eTypeError,"compared with non class/module");}if(FL_TEST(mod,FL_SINGLETON)){if(RCLASS(mod)->m_tbl==RCLASS(arg)->m_tbl)returnQtrue;mod=RBASIC(mod)->klass;}while(mod){if(RCLASS(mod)->m_tbl==RCLASS(arg)->m_tbl)returnQtrue;mod=RCLASS(mod)->super;}/* not mod < arg; check if mod > arg */while(arg){if(RCLASS(arg)->m_tbl==RCLASS(start)->m_tbl)returnQfalse;arg=RCLASS(arg)->super;}returnQnil;}