Class: Variable

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

Overview

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

Parameters:

  • entitythe variables class (a [Class])
  • nodethe node (a [Object])
  • optionsthe parser options (a [Object])
  • classTypewhether its a class variable or not (a [Boolean])
  • 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}

.getName() Source

Get the variable name

Returns:

  • Returns the variable name (a [String])

.getType() Source

Get the variable type, either class or constant

Returns:

  • Returns the variable type (a [String])

.getValue() Source

Get the variable value.

Returns:

  • Returns the value (a [String])

.isConstant() Source

Test if the given value should be treated ad constant.

Returns:

  • Returns true if a constant (a [Boolean])

.toJSON() Source

Get a JSON representation of the object

Returns:

  • Returns the JSON object (a [Object])