Class: Doc

Defined in: src/nodes/doc.coffee
Inherits: Node

Overview

A documentation node is responsible for parsing

Instance Method Summary

Inherited Method Summary

Methods inherited from Node

.findAncestor

Constructor Details

.constructor(node, options)

Construct a documentation node.

Parameters:

  • (Object) nodeThe comment node (a {Object})
  • (Object) optionsThe parser options (a {Object})

Instance Method Details

Boolean .hasComment()

Determines if the current doc has some comments

Returns:

  • (Boolean) — Returns the comment status (a {Boolean}).

Boolean .isInternal()

Is this doc internal?

Returns:

  • (Boolean) — Returns a {Boolean}.

Boolean .isPrivate()

Is this doc private?

Returns:

  • (Boolean) — Returns a {Boolean}.

Boolean .isPublic()

Is this doc public?

Returns:

  • (Boolean) — Returns a {Boolean}.

.leftTrimBlock(lines)

Detect whitespace on the left and removes

Examples:

Parameters:

  • (String) linesThe comment lines [{String}]

.parseBlock(lines)

Parse the given lines as TomDoc and adds the result

.parse_arguments(section)

Parse the member's arguments. Arguments occur subsequent to

Parameters:

  • (String) sectionA {String} containing the argument definitions.

Returns:

  • Returns nothing.

.parse_description(section)

Parse the member description.

Parameters:

  • (String) sectionThe section {String} containing a description.

Returns:

  • Returns nothing.

.parse_examples(section, sections)

Parse the member examples.

Parameters:

  • (String) sectionThe section {String} starting with "Examples"
  • sectionsAll sections subsequent to section.

Returns:

  • Returns nothing.

.parse_returns(section)

Parse the member's return values.

Parameters:

  • (String) sectionThe section {String} starting with "Returns"

Returns:

  • Returns nothing.

Object .toJSON()

Get a JSON representation of the object.

Returns:

  • (Object) — Returns the JSON object (a {Object}).