Skip to content

Instantly share code, notes, and snippets.

@steida
Created April 29, 2009 17:31
Show Gist options
  • Save steida/103913 to your computer and use it in GitHub Desktop.
Save steida/103913 to your computer and use it in GitHub Desktop.
Class = new Type('Class', function(object) {
object.Extends = object.Extends || Class;
var newClass = function() {
return this.initialize ? this.initialize.apply(this, arguments) : this;
} .extend(this);
for (var key in Class.Mutators) {
if (object[key]) Class.Mutators[key].call(newClass, object[key]);
}
newClass.implement(object);
newClass.prototype.constructor = newClass;
return newClass;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment