add_class(class_type, name, superclass = 'Object')
public
Adds a class named name with superclass.
Given class Container::Item RDoc assumes
Container is a module unless it later sees class
Container. add_class
automatically upgrades name to a class in this case.
Show source
def add_class(class_type, name, superclass = 'Object')
klass = add_class_or_module @classes, class_type, name, superclass
existing = klass.superclass
existing = existing.name if existing and not String === existing
if superclass != existing and superclass != 'Object' then
klass.superclass = superclass
end
mod = RDoc::TopLevel.modules_hash.delete klass.full_name
if mod then
klass.classes_hash.update mod.classes_hash
klass.modules_hash.update mod.modules_hash
klass.method_list.concat mod.method_list
@modules.delete klass.name
end
RDoc::TopLevel.classes_hash[klass.full_name] = klass
klass
end