Extracts just the RDoc::Markup::Heading elements from a RDoc::Markup::Document to help build a table of contents
Output accumulator
Adds heading
to the table of contents
# File lib/rdoc/markup/to_table_of_contents.rb, line 24 def accept_heading heading @res << heading end
Returns the table of contents
# File lib/rdoc/markup/to_table_of_contents.rb, line 31 def end_accepting @res end
Prepares the visitor for text generation
# File lib/rdoc/markup/to_table_of_contents.rb, line 38 def start_accepting @res = [] end
Singleton for ToC generation
# File lib/rdoc/markup/to_table_of_contents.rb, line 12 def self.to_toc @to_toc ||= new end