Class

RDoc::CodeObject

Inheritance
< Object

We contain the common stuff for contexts (which are containers) and other elements (methods, attributes and so on)

Attributes

Name Visibility R/W Description
comment public R Access the code object‘s comment
document_children public R do we document ourselves and our children
document_self public R do we document ourselves?
done_documenting public RW are we done documenting (ie, did we come across a :enddoc:)?
force_documentation public RW Do we force documentation, even is we wouldn‘t normally show the entity
parent public RW
section public RW Which section are we in
viewer public RW We are the model of the code, but we know that at some point we will be worked on by viewers. By implementing the Viewable protocol, viewers can associated themselves with these objects.

Methods

Class

Visibility Signature
public attr_overridable (name, *aliases)
public new ()

Instance

Visibility Signature
public comment= (comment)
public document_children= (val)
public document_self= (val)
public remove_classes_and_modules ()
public remove_methods_etc ()
public start_doc ()
public stop_doc ()

Class Method Detail

attr_overridable(name, *aliases)

There‘s a wee trick we pull. Comment blocks can have directives that override the stuff we extract during the parse. So, we have a special class method, attr_overridable, that lets code objects list those directives. Wehn a comment is assigned, we then extract out any matching directives and update our object

new()

Instance Method Detail

comment=(comment)

Update the comment, but don‘t overwrite a real comment with an empty one

document_children=(val)

document_self=(val)

remove_classes_and_modules()

Default callbacks to nothing, but this is overridden for classes and modules

remove_methods_etc()

start_doc()

set and cleared by :startdoc: and :enddoc:, this is used to toggle the capturing of documentation

stop_doc()