Class: OptionsSet

console-base-resource/jgconsole.OptionsSet()

Helps to manage options. The main addition to simply using a Set are the toggle functions and the support for temporarily disabling an option.

Constructor

new OptionsSet()

Creates a new option set.

Source:

Methods

clear()

Clears the option set.

Source:

delete(name)

Deletes the option with the given name.

Parameters:
Name Type Description
name string

the option's name

Source:

disable(name)

Disables the option with the given name. The option and its value are kept and can be re-enabled.

Parameters:
Name Type Description
name string

the option's name

Source:

enable(name)

Re-enables the option with the given name.

Parameters:
Name Type Description
name string

the option's name

Source:

get(name)

Returns the value of the given name.

Parameters:
Name Type Description
name string

the option's name

Source:

getAll()

Returns the names of all options.

Source:

getDisabled()

Returns the names of all disabled options.

Source:

getEnabled()

Returns the names of all enabled options.

Source:

set(name, value)

Sets the option with the associated value.

Parameters:
Name Type Description
name string

the option's name

value string

the option's value

Source:

toggleEnabled(name)

Toggles the option with the given name, i.e. enables it if it is disabled and disables it if it is enabled.

Parameters:
Name Type Description
name string

the option's name

Source:

toggleIsSet(name, value)

Sets the option with the given name if it is not set and deletes it if it is enabled.

Parameters:
Name Type Description
name string

the option's name

value string

the option's value

Source: