Extracts just the RDoc::Markup::Heading elements from a RDoc::Markup::Document to help build a table of contents
Methods
Attributes
| [RW] | omit_headings_below | Omits headings with a level less than the given level. |
| [R] | res | Output accumulator |
Class Public methods
to_toc()
Link
Singleton for table-of-contents generation
Source: show
# File lib/rdoc/markup/to_table_of_contents.rb, line 12 def self.to_toc @to_toc ||= new end
Instance Public methods
accept_document(document)
Link
Adds document to the output, using its heading cutoff if
present
Source: show
# File lib/rdoc/markup/to_table_of_contents.rb, line 35 def accept_document document @omit_headings_below = document.omit_headings_below super end
accept_heading(heading)
Link
Adds heading to the table of contents
Source: show
# File lib/rdoc/markup/to_table_of_contents.rb, line 44 def accept_heading heading @res << heading unless suppressed? heading end
end_accepting()
Link
Returns the table of contents
Source: show
# File lib/rdoc/markup/to_table_of_contents.rb, line 51 def end_accepting @res end