Skip to content

Latest commit

 

History

History
100 lines (68 loc) · 2.72 KB

api.md

File metadata and controls

100 lines (68 loc) · 2.72 KB

Classes

SuperTool

The super tool class. Holds a state and implements the execute command.

Constants

existsboolean

Returns true of a given parameter is not null and not undefined.

SuperTool

The super tool class. Holds a state and implements the execute command.

Kind: global class

new SuperTool(state)

Constructor initializes the state. If none is given, it defaults to {'great'}.

Throws:

  • if state is not a valid state
Param Description
state one of the SuperTool.state values

superTool.state(value) ⇒ String

Validates and sets a new state value if given and returns the updated value. If no defined value is given it just returns the current state value.

Kind: instance method of SuperTool
Returns: String - the current state value

Param Type Description
value String | undefined optional state to be set.

superTool.execute() ⇒ string

Executes with the current internal state.

Kind: instance method of SuperTool
Returns: string - the execution including the current state.

SuperTool.states ⇒ Object

The possible states of the SuperTool.

Kind: static property of SuperTool

SuperTool.validateState(value)

Validates a state. To be valid, the value needs to be part of the {SuperTool.states}. Throws an Error if invalid. Returns void / undefined if passed.

Kind: static method of SuperTool
Throws:

  • if state is not a valid state
Param Description
value The state candidate to be validated.

exists ⇒ boolean

Returns true of a given parameter is not null and not undefined.

Kind: global constant
Returns: boolean - true if defined, otherwise false

Param Description
any any input is feasible