Skip to content
Michael "Z" Goddard edited this page Dec 12, 2011 · 3 revisions

Core

Bump.type

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

Clone this wiki locally