Iterator for each section’s contents sorted by title. The
section, the section’s constants and the sectionsattributes are
yielded. The constants and attributes collections are
sorted.
To retrieve methods in a section use #methods_by_type with the
optional section parameter.
NOTE: Do not edit collections yielded by this method
# File lib/rdoc/context.rb, line 755
def each_section # :yields: section, constants, attributes
return enum_for __method__ unless block_given?
constants = @constants.group_by do |constant| constant.section end
attributes = @attributes.group_by do |attribute| attribute.section end
constants.default = []
attributes.default = []
sort_sections.each do |section|
yield section, constants[section].select(&:display?).sort, attributes[section].select(&:display?).sort
end
end