method
add_class_or_module
v1_9_2_180 -
Show latest stable
- Class:
RDoc::Context
add_class_or_module(collection, class_type, name, superclass = nil)public
# File lib/rdoc/context.rb, line 308
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 the class has been encountered already, check that its
# superclass has been set (it may not have been, depending on the
# context in which it was encountered).
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 Related methods
- Instance methods
- <=>
- add_alias
- add_alias_impl
- add_attribute
- add_class
- add_class_or_module
- add_constant
- add_include
- add_method
- add_module
- add_module_alias
- add_require
- add_to
- child_name
- classes
- classes_and_modules
- classes_hash
- defined_in?
- each_attribute
- each_classmodule
- each_constant
- each_include
- each_method
- find_attribute_named
- find_class_method_named
- find_constant_named
- find_enclosing_module_named
- find_file_named
- find_instance_method_named
- find_local_symbol
- find_method_named
- find_module_named
- find_symbol
- full_name
- http_url
- initialize_classes_and_modules
- initialize_methods_etc
- methods_by_type
- methods_matching
- modules
- modules_hash
- ongoing_visibility=
- record_location
- remove_classes_and_modules
- remove_methods_etc
- set_current_section
- set_visibility_for
- top_level
- Class methods
- new