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”).
VALUErb_class_inherited_p(VALUEmod,VALUEarg){VALUEstart=mod;if(mod==arg)returnQtrue;switch(TYPE(arg)){caseT_MODULE:caseT_CLASS:break;default:rb_raise(rb_eTypeError,"compared with non class/module");}while(mod){if(RCLASS_M_TBL(mod)==RCLASS_M_TBL(arg))returnQtrue;mod=RCLASS_SUPER(mod);}/* not mod < arg; check if mod > arg */while(arg){if(RCLASS_M_TBL(arg)==RCLASS_M_TBL(start))returnQfalse;arg=RCLASS_SUPER(arg);}returnQnil;}