}
// --- Version
Class.version = '1.0.0'
Class.version = '1.1.0'
/**
* Create a new class.
*
initialize = false
var prototype = new this
initialize = true
for (var name in props)
prototype[name] =
typeof props[name] == 'function' &&
typeof __super__[name] == 'function' &&
referencesSuper.test(props[name]) ?
(function(name, fn){
return function() {
this.__super__ = __super__[name]
return fn.apply(this, arguments)
}
})(name, props[name])
: props[name]
function Class() {
if (initialize && this.init)
this.init.apply(this, arguments)
}
Class.include = function(props) {
for (var name in props)
if (name == 'include')
if (props[name] instanceof Array)
for (var i = 0, len = props[name].length; i < len; ++i)
Class.include(props[name][i])
else
Class.include(props[name])
else if (props.hasOwnProperty(name))
prototype[name] =
typeof props[name] == 'function' &&
typeof __super__[name] == 'function' &&
referencesSuper.test(props[name]) ?
(function(name, fn){
return function() {
this.__super__ = __super__[name]
return fn.apply(this, arguments)
}
})(name, props[name])
: props[name]
}
Class.include(props)
Class.prototype = prototype
Class.constructor = Class
Class.extend = arguments.callee