API Documentation for: 0.1.0
Show:

Utils Class

Defined in: Utils:55
Module: StateJS

List of internal and helper functions in StateJS.

Item Index

Methods

Methods

Class

(
  • baseClass
)
Object

Defined in Class:87

Class is a meta-factory function to create classes in JavaScript. It is a shortcut for the CreateJS syntax style. By default, the class created by this function have an initialize function (the constructor). Optionally, you can specify the inheritance by passing another class as parameter.

By default, all classes created using this function, may receives only a settings parameter as argument. This pattern is commonly used by jQuery and its plugins.

Usage

// Creating a simple class
var BaseClass = statejs.Class();

// Using inheritance
var ChildClass = statejs.Class(BaseClass);

// Defining the constructor
ChildClass.prototype.initialize = function(settings) { ... }

Parameters:

  • baseClass Object

    The super class.

Returns:

Object:

A new class.

createUUID

() String

Defined in createUUID:61

This function is used to create unique IDs for machines and states.

(consult http://www.ietf.org/rfc/rfc4122.txt).

Returns:

String:

A unique ID.