add_class_or_module(collection, class_type, name, superclass = nil)
public
Show source
def add_class_or_module(collection, class_type, name, superclass = nil)
full_name = child_name name
mod = collection[name]
if mod then
mod.superclass = superclass unless mod.module?
else
all = if class_type == RDoc::NormalModule then
RDoc::TopLevel.modules_hash
else
RDoc::TopLevel.classes_hash
end
mod = all[full_name]
unless mod then
mod = class_type.new name, superclass
else
if class_type == RDoc::NormalClass then
mod.superclass = superclass unless mod.superclass
end
end
unless @done_documenting then
all[full_name] = mod
collection[name] = mod
end
mod.section = @current_section
mod.parent = self
end
mod
end