Class: KssParameter

kss.KssParameter(dataopt)

A KssParameter object represents a single parameter of a KssSection.

This class is normally accessed via the kss module:

const KssParameter = require('kss').KssParameter;

Constructor

new KssParameter(dataopt)

Creates a KssParameter object and stores the given data.

If passed an object, it will add section, name, and description properties.

Parameters:
Name Type Attributes Description
data Object <optional>

An object of data.

Source:

Methods

defaultValue(defaultValue) → {string|KssParameter}

Gets or sets the default value of the KssParameter.

If the defaultValue value is provided, the default value of this KssParameter is set. Otherwise, the default value of the KssParameter is returned.

Parameters:
Name Type Description
defaultValue string

Optional. The default value of the KssParameter.

Source:
Returns:

If defaultValue is given, the current KssParameter object is returned to allow chaining of methods. Otherwise, the default value of the KssParameter is returned.

Type
string | KssParameter

description(descriptionopt) → {string|KssParameter}

Gets or sets the description of the KssParameter.

If the description is provided, the description of this KssParameter is set. Otherwise, the description of the KssParameter is returned.

Parameters:
Name Type Attributes Description
description string <optional>

Optional. The description of the KssParameter.

Source:
Returns:

If description is given, the current KssParameter object is returned to allow chaining of methods. Otherwise, the description of the KssParameter is returned.

Type
string | KssParameter

name(nameopt) → {string|KssParameter}

Gets or sets the name of the KssParameter.

If the name value is provided, the name of this KssParameter is set. Otherwise, the name of the KssParameter is returned.

Parameters:
Name Type Attributes Description
name string <optional>

Optional. The name of the KssParameter.

Source:
Returns:

If name is given, the current KssParameter object is returned to allow chaining of methods. Otherwise, the name of the KssParameter is returned.

Type
string | KssParameter

section(sectionopt) → {KssSection|KssParameter}

Gets or sets the KssSection object this KssParameter is associated with.

If the section value is provided, the KssSection for this parameter is set. Otherwise, the KssSection of the parameter is returned.

Parameters:
Name Type Attributes Description
section KssSection <optional>

Optional. The KssSection that owns the KssParameter.

Source:
Returns:

If section is given, the current KssParameter object is returned to allow chaining of methods. Otherwise, the KssSection object the parameter belongs to is returned.

Type
KssSection | KssParameter

toJSON() → {Object}

Return the KssParameter as a JSON object.

Source:
Returns:

A JSON object representation of the KssParameter.

Type
Object