RDoc::Markup::

ToTableOfContents

class

Extracts just the RDoc::Markup::Heading elements from a RDoc::Markup::Document to help build a table of contents

Attributes

res[R]

Output accumulator

Public Class Methods

to_toc()

Singleton for ToC generation

# File lib/rdoc/markup/to_table_of_contents.rb, line 12
def self.to_toc
  @to_toc ||= new
end

Public Instance Methods

accept_heading(heading)

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
end_accepting()

Returns the table of contents

# File lib/rdoc/markup/to_table_of_contents.rb, line 31
def end_accepting
  @res
end
start_accepting()

Prepares the visitor for text generation

# File lib/rdoc/markup/to_table_of_contents.rb, line 38
def start_accepting
  @res = []
end