Class: ConfigTmpl

ConfigTmpl

Type safe config class This is a configuration template, it has, for each configuration key, the following: - the key itself (string). - the type of the value for that key. - the default value for the key (of the same type). - an optional validation function. - is this option required - description of the option

Constructor

new ConfigTmpl()

Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

Members

(static) fullSet

All needed properties for each config option.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

(static) types

All allowed types for config options.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

Methods

add(s)

add another option to this template
This:
Parameters:
Name Type Description
s object config option with all needed properties.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

check(key, value)

check that a key,value combo is ok This method will throw an exception if it finds anything wrong.
This:
Parameters:
Name Type Description
key string key to check.
value anything value to check.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

getDefaultValue(key) → {anything}

return the default value for a key
This:
Parameters:
Name Type Description
key string the key to fetch the value for.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
the default value for the given key.
Type
anything

getHTML() → {string}

show HTML that lists all config options for the current template
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
HTML representation of this config template.
Type
string

hasKey(key) → {boolean}

return whether the template has a key
This:
Parameters:
Name Type Description
key string the key to check.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
is the key part of this config template.
Type
boolean

initialize() → {ConfigTmpl}

create a new instance of this class.
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
a new instance of this class.
Type
ConfigTmpl