section_contents()public
Returns RDoc::Context::Section objects referenced in this context for use in a table of contents.
# File lib/rdoc/context.rb, line 1120
def section_contents
used_sections = {}
each_method do |method|
next unless method.display?
used_sections[method.section] = true
end
# order found sections
sections = sort_sections.select do |section|
used_sections[section]
end
# only the default section is used
return [] if
sections.length == 1 and not sections.first.title
sections
end Related methods
- Instance methods
- <=>
- add
- add_alias
- add_attribute
- add_class
- add_class_or_module
- add_constant
- add_extend
- add_include
- add_method
- add_module
- add_module_alias
- add_require
- add_section
- add_to
- any_content
- child_name
- class_attributes
- class_method_list
- classes
- classes_and_modules
- classes_hash
- current_section
- defined_in?
- display
- each_ancestor
- each_attribute
- each_classmodule
- each_constant
- each_extend
- each_include
- each_method
- each_section
- find_attribute
- find_attribute_named
- find_class_method_named
- find_constant_named
- find_enclosing_module_named
- find_external_alias
- find_external_alias_named
- find_file_named
- find_instance_method_named
- find_local_symbol
- find_method
- find_method_named
- find_module_named
- find_symbol
- find_symbol_module
- full_name
- fully_documented?
- http_url
- initialize_methods_etc
- instance_attributes
- instance_method_list
- methods_by_type
- methods_matching
- modules
- modules_hash
- name_for_path
- ongoing_visibility=
- record_location
- remove_from_documentation?
- remove_invisible
- remove_invisible_in
- resolve_aliases
- section_contents
- sections
- sections_hash
- set_constant_visibility_for
- set_current_section
- set_visibility_for
- sort_sections
- to_s
- top_level
- upgrade_to_class
- Class methods
- new