-
Notifications
You must be signed in to change notification settings - Fork 3
Core
Michael "Z" Goddard edited this page Dec 12, 2011
·
3 revisions
Bump.type( {
init: function( name ) {
this._name = name;
},
members: {
nameSquared: function() {
return this.name.length * this.name.length;
}
},
properties: {
name: {
get: function() {
return this._name;
}
}
}
} );
By default defines a create function on the returned type that passes arguments to init.
Returns:
A new Type object
Parameters:
- parent: parent Type object
- init: constructor method. include a function name.
- members: object listing name/object pairs typically methods
- properties: object listing name/object pairs that become properties
- typeMembers: object listing name/object pairs attached to the returned type object