Static

Description

Creating a class. the constructor is the method "initialize"

Usage

Parameters

  • name {String}

    Class name

  • methods {Object}

    Methods and properties of the class

Returns

Kernel

Example

Class.create("Foo", {
    bar: null,
    initialize: function(bar) {
        this.bar = bar;
    }
});
var foo = Class.new("Foo", ["Hello World"]);

Discussion