Class: Variable

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

Overview

The Node representation of a CoffeeScript variable.

Instance Method Summary

Inherited Method Summary

Methods inherited from Node

.findAncestor

Constructor Details

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

Construct a variable node.

Parameters:

  • (Class) entityThe variable's Class
  • (Object) nodeThe variable node (a Object)
  • smcAn 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

Get the class doc

Returns:

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

Number ::getLocation() Source

Get the source line number

Returns:

  • (Number) — Returns a Number.

String ::getName() Source

Get the variable name

Returns:

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

String ::getType() Source

Get the variable type, either class or constant

Returns:

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

String ::getValue() Source

Get the variable value.

Returns:

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

Boolean ::isConstant() Source

Test if the given value should be treated ad constant.

Returns:

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

Object ::toJSON() Source

Get a JSON representation of the object

Returns:

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