Lines Matching refs:super

70  * \param super     a class from which the new class derives.
72 * \pre \a super must be a class.
76 rb_class_boot(VALUE super)
80 RCLASS_SUPER(klass) = super;
83 OBJ_INFECT(klass, super);
89 * Ensures a class can be derived from super.
91 * \param super a reference to an object.
92 * \exception TypeError if \a super is not a Class or \a super is a singleton class.
95 rb_check_inheritable(VALUE super)
97 if (!RB_TYPE_P(super, T_CLASS)) {
99 rb_obj_classname(super));
101 if (RBASIC(super)->flags & FL_SINGLETON) {
104 if (super == rb_cClass) {
112 * \param super a class from which the new class derives.
113 * \exception TypeError \a super is not inheritable.
114 * \exception TypeError \a super is the Class class.
117 rb_class_new(VALUE super)
119 Check_Type(super, T_CLASS);
120 rb_check_inheritable(super);
121 return rb_class_boot(super);
342 VALUE super;
357 super = RCLASS_SUPER(klass);
358 while (RB_TYPE_P(super, T_ICLASS)) super = RCLASS_SUPER(super);
359 RCLASS_SUPER(metaclass) = super ? ENSURE_EIGENCLASS(super) : rb_cClass;
388 boot_defclass(const char *name, VALUE super)
391 VALUE obj = rb_class_boot(super);
444 * \param super A class from which the new class will derive. NULL means \c Object class.
446 * \throw TypeError if super is not a \c Class object.
452 rb_define_class_id(ID id, VALUE super)
456 if (!super) super = rb_cObject;
457 klass = rb_class_new(super);
458 rb_make_metaclass(klass, RBASIC(super)->klass);
466 * \param super A class which will be called #inherited.
468 * \param klass A Class object which derived from \a super
470 * \pre Each of \a super and \a klass must be a \c Class object.
473 rb_class_inherited(VALUE super, VALUE klass)
476 if (!super) super = rb_cObject;
478 return rb_funcall(super, inherited, 1, klass);
486 * \param super a class from which the new class will derive.
492 * be reopened because its superclass is not \a super.
496 * \a super, the function just returns the defined class.
499 rb_define_class(const char *name, VALUE super)
510 if (rb_class_real(RCLASS_SUPER(klass)) != super) {
515 if (!super) {
516 rb_warn("no super class for `%s', Object assumed", name);
518 klass = rb_define_class_id(id, super);
522 rb_class_inherited(super, klass);
532 * \param super a class from which the new class will derive.
538 * be reopened because its superclass is not \a super.
542 * \a super, the function just returns the defined class.
545 rb_define_class_under(VALUE outer, const char *name, VALUE super)
547 return rb_define_class_id_under(outer, rb_intern(name), super);
555 * \param super a class from which the new class will derive.
561 * be reopened because its superclass is not \a super.
565 * \a super, the function just returns the defined class.
568 rb_define_class_id_under(VALUE outer, ID id, VALUE super)
577 if (rb_class_real(RCLASS_SUPER(klass)) != super) {
582 if (!super) {
583 rb_warn("no super class for `%s::%s', Object assumed",
586 klass = rb_define_class_id(id, super);
589 rb_class_inherited(super, klass);
663 rb_include_class_new(VALUE module, VALUE super)
679 RCLASS_SUPER(klass) = super;
687 OBJ_INFECT(klass, super);