Class: Class

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

Overview

The Node representation of a CoffeeScript class.

Direct Known Subclasses

File

Instance Method Summary

Inherited Method Summary

Methods inherited from Node

.findAncestor

Constructor Details

.constructor(node, fileName, lineMapping, options, comment)

Constructs a class.

Parameters:

  • (Object) nodeThe class node (a {Object})
  • (String) fileNameThe filename (a {String})
  • (Object) optionsThe parser options (a {Object})
  • (Object) commentThe comment node (a {Object})

Instance Method Details

String .getClassName()

Get the full class name

Returns:

  • (String) — Returns the class (a {String})

.getDoc()

Get the class doc

Returns:

  • Returns the class doc (a [Doc])

String .getFileName()

Get the source file name.

Returns:

  • (String) — Returns the filename of the class (a {String})

String .getFullName()

Alias for {::getClassName}

Returns:

  • (String) — Returns the full class name (a {String})

Number .getLocation()

Get the source line number

Returns:

  • (Number) — Returns a {Number}.

Array .getMethods()

Get all methods.

Returns:

  • (Array) — Returns the methods as an {Array}.

String .getName()

Get the class name

Returns:

  • (String) — Returns the name (a {String})

String .getNamespace()

Get the class namespace

Returns:

  • (String) — Returns the namespace (a {String}).

String .getParentClassName()

Get the full parent class name

Returns:

  • (String) — Returns the parent class name (a {String}).

Array .getVariables()

Get all variables.

Returns:

  • (Array) — Returns the variables as an {Array}.

Object .toJSON()

Get a JSON representation of the object

Returns:

  • (Object) — Returns the JSON object (an {Object})