Class Variable

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

Overview

Public: The Node representation of a CoffeeScript variable.

Instance Method Summary

Inherited Method Summary

Methods inherited from Node

.findAncestor

Constructor Details

::constructor(entity, node, lineMapping, options, classType = false, comment = null) Source

Public: Construct a variable node. entity - The variable's Class node - The variable node (a Object) lineMapping - An object mapping the actual position of a member to its Biscotto one options - The parser options (a Object) classType - A Boolean indicating if the class is a `class` or an `instance` comment - The comment node (a Object)

Parameters:

  • (Class) entityThe variable's Class
  • (Object) nodeThe variable node (a Object)
  • lineMappingAn object mapping the actual position of a member to its Biscotto one
  • (Object) optionsThe parser options (a Object)
  • (Boolean) classTypeA Boolean indicating if the class is a class or an instance
  • (Object) commentThe comment node (a Object)

Instance Method Details

::getDoc() Source

Public: Get the class doc Returns the class doc (a [Doc]).

Returns:

  • Returns the class doc (a [Doc]).

Number ::getLocation() Source

Public: Get the source line number Returns a Number.

Returns:

  • (Number) — Returns a Number.

String ::getName() Source

Public: Get the variable name Returns the variable name (a String).

Returns:

  • (String) — Returns the variable name (a String).

String ::getType() Source

Public: Get the variable type, either `class` or `constant` Returns the variable type (a String).

Returns:

  • (String) — Returns the variable type (a String).

String ::getValue() Source

Public: Get the variable value. Returns the value (a String).

Returns:

  • (String) — Returns the value (a String).

Boolean ::isConstant() Source

Public: Test if the given value should be treated ad constant. Returns true if a constant (a Boolean)

Returns:

  • (Boolean) — Returns true if a constant (a Boolean)

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).