FaceValue(value, attributesopt)

new FaceValue(value, attributesopt)

The FaceValue class handles all the digitizing for the Face.

Parameters:
Name Type Attributes Description
value *

The FaceValue's actual value. Most likely should string, number, or Date. But since the Face handles the value, it could be anything.

attributes object | undefined <optional>

The instance attributes.

Source:

Extends

Members

digits :Array|undefined

The digits attribute.

Type:
  • Array | undefined
Source:

events :object

The events attribute.

Type:
  • object
Inherited From:
Source:

name :string

Get the name attribute.

Type:
  • string
Inherited From:
Source:

value :*

The value attribute.

Type:
  • *
Source:

Methods

(static) defineName() → {string}

Define the name of the class.

Source:
Returns:
Type
string

callback(fn) → {*}

Helper method to execute the callback() function.

Parameters:
Name Type Description
fn function

The callback function.

Inherited From:
Source:
Returns:
  • Returns the executed callback function.
Type
*

clone(value, attributesopt) → {FaceValue}

Clones the current FaceValue instance, but sets a new value to the cloned instance. Used for copying the current instance options and methods, but setting a new value.

Parameters:
Name Type Attributes Description
value *

The n

attributes object | undefined <optional>

The instance attributes.

Source:
Returns:
  • The cloned FaceValue.
Type
FaceValue

emit(key) → {Component}

Emit an event.

Parameters:
Name Type Description
key string

The event id/key.

Inherited From:
Source:
Returns:
  • Returns this instance.
Type
Component

getAttribute(key) → {*}

Get an attribute. Returns null if no attribute is defined.

Parameters:
Name Type Description
key string

The attribute name.

Inherited From:
Source:
Returns:
  • The attribute value.
Type
*

getAttributes() → {object}

Get all the atttributes for this instance.

Inherited From:
Source:
Returns:
  • The attribute dictionary.
Type
object

getPublicAttributes() → {object}

Get only public the atttributes for this instance. Omits any attribute that starts with $, which is used internally.

Inherited From:
Source:
Returns:
  • The attribute dictionary.
Type
object

isNaN() → {boolean}

Returns true if the value attribute is not a number.

Source:
Returns:
  • true is the value is not a number.
Type
boolean

isNumber() → {boolean}

Returns true if the value attribute is a number.

Source:
Returns:
  • true is the value is a number.
Type
boolean

off(key, fn) → {Component}

Stop listening to an event.

Parameters:
Name Type Description
key string

The event id/key.

fn function | undefined

The listener callback function. If no function is defined, all events with the specified id/key will be removed. Otherwise, only the event listeners matching the id/key AND callback will be removed.

Inherited From:
Source:
Returns:
  • Returns this instance.
Type
Component

on(key, fn, onceopt) → {Component}

Start listening to an event.

Parameters:
Name Type Attributes Default Description
key string

The event id/key.

fn function

The listener callback function.

once boolean <optional>
false

Should the event handler be fired a single time.

Inherited From:
Source:
Returns:
  • Returns this instance.
Type
Component

once(key, fn) → {Component}

Listen to an event only one time.

Parameters:
Name Type Description
key string

The event id/key.

fn function

The listener callback function.

Inherited From:
Source:
Returns:
  • Returns this instance.
Type
Component

setAttribute(key, value) → {void}

Set an attribute key and value.

Parameters:
Name Type Description
key string

The attribute name.

value *

The attribute value.

Inherited From:
Source:
Returns:
Type
void

setAttributes(values) → {void}

Set an attributes by object of key/value pairs.

Parameters:
Name Type Description
values object

The object dictionary.

Inherited From:
Source:
Returns:
Type
void