Class

You can extend the functionality of modules using classes.

Create your class for the module like this:

$K.add('class', 'mymodule.myclass', {
    init: function(app, mymodule)
    {
        this.app = app;
    },
    classMethod: function()
    {
        return true;
    }
});

Now you can initialize the class in the module and access its methods.

$K.add('module', 'mymodule', {
    init: function(app)
    {
        this.app = app;
    },
    myMethod: function()
    {
        var myClass = $K.create('class.mymodule.myclass', this.app, this);

        myClass.classMethod();
    }
});