method
merge
v2_1_10 -
Show latest stable
- Class:
RDoc::ClassModule
merge(class_module)public
Merges class_module into this ClassModule.
The data in class_module is preferred over the receiver.
# File lib/rdoc/class_module.rb, line 432
def merge class_module
@parent = class_module.parent
@parent_name = class_module.parent_name
other_document = parse class_module.comment_location
if other_document then
document = parse @comment_location
document = document.merge other_document
@comment = @comment_location = document
end
cm = class_module
other_files = cm.in_files
merge_collections attributes, cm.attributes, other_files do |add, attr|
if add then
add_attribute attr
else
@attributes.delete attr
@methods_hash.delete attr.pretty_name
end
end
merge_collections constants, cm.constants, other_files do |add, const|
if add then
add_constant const
else
@constants.delete const
@constants_hash.delete const.name
end
end
merge_collections includes, cm.includes, other_files do |add, incl|
if add then
add_include incl
else
@includes.delete incl
end
end
@includes.uniq! # clean up
merge_collections extends, cm.extends, other_files do |add, ext|
if add then
add_extend ext
else
@extends.delete ext
end
end
@extends.uniq! # clean up
merge_collections method_list, cm.method_list, other_files do |add, meth|
if add then
add_method meth
else
@method_list.delete meth
@methods_hash.delete meth.pretty_name
end
end
merge_sections cm
self
end Related methods
- Instance methods
- add_comment
- add_things
- ancestors
- aref
- aref_prefix
- clear_comment
- comment=
- complete
- description
- direct_ancestors
- document_self_or_methods
- documented?
- each_ancestor
- find_ancestor_local_symbol
- find_class_named
- full_name
- marshal_dump
- marshal_load
- merge
- merge_collections
- merge_sections
- module?
- name=
- name_for_path
- non_aliases
- parse
- path
- remove_nodoc_children
- remove_things
- search_record
- store=
- superclass
- superclass=
- to_s
- type
- update_aliases
- update_extends
- update_includes
- Class methods
- from_module
- new