- SuperTool
The super tool class. Holds a state and implements the execute command.
- exists ⇒
boolean
Returns true of a given parameter is not null and not undefined.
The super tool class. Holds a state and implements the execute command.
Kind: global class
- SuperTool
- new SuperTool(state)
- instance
- .state(value) ⇒
String
- .execute() ⇒
string
- .state(value) ⇒
- static
- .states ⇒
Object
- .validateState(value)
- .states ⇒
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 |
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. |
Executes with the current internal state.
Kind: instance method of SuperTool
Returns: string
- the execution including the current state.
The possible states of the SuperTool.
Kind: static property of SuperTool
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. |
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 |