A parser is a class that subclasses RDoc::Parser and implements
#initialize top_level, file_name, body, options, stats
The initialize method takes a file name to be used, the body of the file, and an RDoc::Options object. The scan method is then called to return an appropriately parsed TopLevel code object.
require "rdoc/parser" class RDoc::Parser::Xyz < RDoc::Parser parse_files_matching /\.xyz$/ # <<<< def initialize top_level, file_name, body, options, stats ... end def scan ... end end