123456789_123456789_123456789_123456789_123456789_

Class: RDoc::Parser::RD

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: RDoc::Parser
Defined in: lib/rdoc/parser/rd.rb

Overview

Parse a RD format file. The parsed ::RDoc::Markup::Document is attached as a file comment.

Class Attribute Summary

::RDoc::Parser - Inherited

.parsers

An Array of arrays that maps file extension (or name) regular expressions to parser classes that will parse matching filenames.

Class Method Summary

::RDoc::Parser - Inherited

.alias_extension

::RDoc::Alias an extension to another extension.

.binary?

Determines if the file is a “binary” file which basically means it has content that an ::RDoc::RDoc parser shouldn't try to consume.

.can_parse

Return a parser that can handle a particular extension.

.can_parse_by_name

Returns a parser that can handle the extension for #file_name.

.check_modeline

Returns the file type from the modeline in #file_name

.for

Finds and instantiates the correct parser for the given #file_name and content.

.new

Creates a new ::RDoc::Parser storing top_level, #file_name, content, options and stats in instance variables.

.parse_files_matching

Record which file types this parser can understand.

.process_directive

Processes common directives for CodeObjects for the C and Ruby parsers.

.remove_modeline

Removes an emacs-style modeline from the first line of the document.

.use_markup

If there is a markup: parser_name comment at the front of the file, use it to determine the parser.

.zip?

Checks if file is a zip file in disguise.

Instance Attribute Summary

::RDoc::Parser - Inherited

#file_name

The name of the file being parsed.

Instance Method Summary

Constructor Details

This class inherits a constructor from RDoc::Parser

Instance Method Details

#scan

Creates an rd-format ::RDoc::TopLevel for the given file.

[ GitHub ]

  
# File 'lib/rdoc/parser/rd.rb', line 14

def scan
  comment = RDoc::Comment.new @content, @top_level
  comment.format = 'rd'

  @top_level.comment = comment
end