Show:

Attribute implementation.

Constructor

Attribute

()

Methods

_callStringOrFunction

(
  • stringOrFunction
  • args
)
Any protected

Calls the provided param as function with the supplied arguments. If param provided as string, a corresponding function in this object will be called. If provided param is a function, it will be directly called.

Parameters:

  • stringOrFunction String | Function

    The function which should be called

  • args Any | Array

    The arguments which will be provided to the called function

Returns:

Any:

The returned value from the called function

_init

(
  • attr
)
protected

Initializes an attribute. Sets its default value depending on the flags of the attribute and the passed configuration object to the constructor.

Parameters:

  • attr String

    The name of the attribute which have to be initialized.

_isInitialized

(
  • attr
)
Boolean protected

Checks if an attribute is initialized. An attribute is considered as initialized when there is an own property with this name in the local collection of attribute values for the current instance.

Parameters:

  • attr String

    The attribute which should be checked if it is initialized.

Returns:

Boolean:

Returns true if the attribute has been initialized, false otherwise.

get

(
  • attr
)
Any

Retrieves the value of an attribute.

Parameters:

  • attr String

    The attribute which value should be retrieved.

Returns:

Any:

The value of the attribute.

set

(
  • attr
  • value
)

Sets the value of an attribute.

Parameters:

  • attr String

    The attribute which value should be set.

  • value Any

    The value which should be set to the attribute.