Description

add object in this class

Usage

Parameters

  • object {Object|String}

    or name of existing class

  • clone {Boolean} optional

    (optional) Makes a clone of the object (false by default)

Returns

Object

Example

Example 1 :

Class.create("Foo", {

    mymethod: function() {

    }

}).extend({
    othermethod: function() {

    }
});

Example 2 :

Class.create("Bar", {

    initialize: function() {

    }

});

Class.create("Foo", {

    mymethod: function() {

    }

}).extend("Bar");

Discussion