Module Index

Constructor

Class: ClassDoc

Documentation for a single class.

Constructor

__init__ (self, parsed_comment)

Initialize this object from a parsed comment dictionary. add_method must be called later to populate the methods property with FunctionDoc.

Methods

add_method (self, method)

Add a FunctionDoc method to this class. Called automatically if this ClassDoc was constructed from a CodeBaseDoc.

get (self, tag_name, default='')

Return the value of a particular tag, or None if that tag doesn't exist. Use 'doc' for the comment body itself.

get_as_list (self, tag_name)

Return the value of a tag, making sure that it's a list. Absent tags are returned as an empty-list; single tags are returned as a one-element list.

The returned list is a copy, and modifications do not affect the original object.

get_method (self, method_name, default=None)

Returns the contained method of the specified name, or default if not found.

has_method (self, method_name)

Returns True if this class contains the specified method.

to_dict (self)

Convert this ClassDoc to a dict, such as if you want to use it in a template or string interpolation. Aside from the basic CommentDoc fields, this also contains:

  • name: The class name
  • method: A list of methods, in their dictionary form.

to_html (self, codebase)

Convert this ClassDoc to HTML. This returns the default long-form HTML description that's used when the full docs are built.

to_json (self)

Return a JSON representation of the CommentDoc. Keys are as per to_dict.

Properties

constructors

Read only

Return all methods labeled with the @constructor tag.

doc

Read only

Return the comment body.

name

Read only

see

Read only

Return a list of all @see tags on the comment.

superclass

Read only

Return the immediate superclass name of the class, as a string. For the full inheritance chain, use the all_superclasses property, which returns a list of objects and only works if this ClassDoc was created from a CodeBaseDoc.

url

Read only

Return a URL for the comment, within the page.