method
merge_sections
v2_2_9 -
Show latest stable
- Class:
RDoc::ClassModule
merge_sections(cm)public
Merges the comments in this ClassModule with the comments in the other ClassModule cm.
# File lib/rdoc/class_module.rb, line 528
def merge_sections cm # :nodoc:
my_sections = sections.group_by { |section| section.title }
other_sections = cm.sections.group_by { |section| section.title }
other_files = cm.in_files
remove_things my_sections, other_files do |_, section|
@sections.delete section.title
end
other_sections.each do |group, sections|
if my_sections.include? group
my_sections[group].each do |my_section|
other_section = cm.sections_hash[group]
my_comments = my_section.comments
other_comments = other_section.comments
other_files = other_section.in_files
merge_collections my_comments, other_comments, other_files do |add, comment|
if add then
my_section.add_comment comment
else
my_section.remove_comment comment
end
end
end
else
sections.each do |section|
add_section group, section.comments
end
end
end
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