Class Doc

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

Overview

Public: A documentation node is responsible for parsing the comments for known tags.

Instance Method Summary

Inherited Method Summary

Methods inherited from Node

.findAncestor

Constructor Details

::constructor(node, options) Source

Public: Construct a documentation node. node - The comment node (a Object) options - The parser options (a Object)

Parameters:

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

Instance Method Details

Boolean ::hasComment() Source

Public: Determines if the current doc has some comments Returns the comment status (a Boolean).

Returns:

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

Boolean ::isInternal() Source

Public: Is this doc internal? Returns a Boolean.

Returns:

Boolean ::isPrivate() Source

Public: Is this doc private? Returns a Boolean.

Returns:

Boolean ::isPublic() Source

Public: Is this doc public? Returns a Boolean.

Returns:

::leftTrimBlock(lines) Source

Public: Detect whitespace on the left and removes the minimum whitespace amount. lines - The comment lines [String] Examples leftTrimBlock(['', ' Escape at maximum speed.', '', ' @param (see #move)', ' ']) => ['', 'Escape at maximum speed.', '', '@param (see #move)', ''] This will keep indention for examples intact. Returns the left trimmed lines as an Array of Strings.

Examples:

leftTrimBlock(['', '  Escape at maximum speed.', '', '  @param (see #move)', '  '])
=> ['', 'Escape at maximum speed.', '', '@param (see #move)', '']

Parameters:

  • (String) linesThe comment lines [String]

::parseBlock(lines) Source

Public: Parse the given lines as TomDoc and adds the result to the result object.

::parse_arguments(section) Source

Public: Parse the member's arguments. Arguments occur subsequent to the description. section - A String containing the argument definitions. Returns nothing.

Parameters:

  • (String) sectionA String containing the argument definitions.

Returns:

  • Returns nothing.

::parse_description(section) Source

Public: Parse the member description. section - The section String containing a description. Returns nothing.

Parameters:

  • (String) sectionThe section String containing a description.

Returns:

  • Returns nothing.

::parse_examples(section, sections) Source

Public: Parse the member examples. section - The section String starting with "Examples" sections - All sections subsequent to `section`. Returns nothing.

Parameters:

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

Returns:

  • Returns nothing.

::parse_returns(section) Source

Public: Parse the member's return values. section - The section String starting with "Returns" Returns nothing.

Parameters:

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

Returns:

  • Returns nothing.

Object ::toJSON() Source

Public: Get a JSON representation of the object. Returns the JSON object (a Object).

Returns:

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