Class: Parameter

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

Overview

The Node representation of a CoffeeScript method parameter.

Instance Method Summary

Inherited Method Summary

Methods inherited from Node

.findAncestor

Constructor Details

.constructor(node, options, optionized)

Construct a parameter node.

Parameters:

  • (Object) nodeThe node (a {Object})
  • (Object) optionsThe parser options (a {Object})
  • (Boolean) optionizedA {Boolean} indicating if the parameter is a set of options

Instance Method Details

String .getDefault(i = -1)

Get the parameter default value

Returns:

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

String .getName(i = -1)

Get the parameter name

Returns:

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

String .getOptionizedDefaults()

Gets the defaults of the optionized parameters.

Returns:

  • (String) — Returns the defaults as a {String}.

String .getSignature()

Get the full parameter signature.

Returns:

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

Boolean .isSplat()

Checks if the parameters is a splat

Returns:

  • (Boolean) — Returns true if a splat (a {Boolean}).

Object .toJSON(i = -1)

Get a JSON representation of the object

Returns:

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