menu

SiteGenesis / Server-side JS / Class: Class

util/Class~ Class

new Class()

Base class which allows simple inheritance.

Source:
Example
var MyClass = Class.extends({
    init : function(){
        // do some construction
    }
})

// you can call the super class's method from within any method like this
...
    myMethod : function(){
        // call 'myMethod' of super class
        this._super();
    }

Methods

extend(prop) → {Object}

Create a new sub class

Parameters:
Name Type Description
prop Object

An object defining the members of the sub class

Source:
Returns:

The sub class

Type
Object