RDoc::Parser::C

RDoc::Parser::C attempts to parse C extension files. It looks for the standard patterns
that you find in extensions: rb_define_class, rb_define_method
and so on. It tries to find the corresponding C
source for the methods and extract comments, but if we fail we don't worry
too much.

The comments associated with a Ruby method are extracted from the C comment block associated with the routine that
implements that method, that is to say the method whose name is
given in the rb_define_method call. For example, you might
write:

Here RDoc will determine from the
rb_define_method line that there’s a method called “flatten” in class
Array, and will look for the implementation in the method rb_ary_flatten.
It will then use the comment from that method in the HTML output. This
method must be in the same source file as the rb_define_method.

The comment blocks may include special directives:

Document-class: name

Documentation for the named class.

Document-module: name

Documentation for the named module.

Document-const: name

Documentation for the named rb_define_const.

Constant values can be supplied on the first line of the comment like so:

Look for class or module documentation above Init_+class_name+(void), in a
Document-class class_name (or module) comment or above an
rb_define_class (or module). If a comment is supplied above a matching
Init_ and a rb_define_class the Init_ comment is used.