Module: UWA/Class/Options

UWA/Class/Options

Classes implementing or extending this Class will have extra methods to handle options.

Example

define('MyProject/Class/Person', [
    'UWA/Class',
    'UWA/Class/Options'
], function (Class, Options) {

    var Person = Class.extend(Options, {

        init: function (options) {
            this.setOptions(options);
        },

        getName: function() {
            return this.getOption('name', 'Guest'):
        },

        setName: function(value) {
            return this.setOption('name', value):
       }
    });

    return Person;
});

require(['MyProject/Class/Person'], function (MyClass) {

var bob = new MyClass({
    name: 'Bob'
});

bob.getName(); // Return Bob

});

Classes

UWA.Class.Options