Skip to content

Instantly share code, notes, and snippets.

@DeadWisdom
Created January 19, 2013 22:37
Show Gist options
  • Save DeadWisdom/4575639 to your computer and use it in GitHub Desktop.
Save DeadWisdom/4575639 to your computer and use it in GitHub Desktop.
Person = Tea.Object.extend({
type: 'person',
name: null,
__init__ : function() {
console.log("New person made named: " + this.name);
},
foo : function(args) {
console.log("Bar");
}
});
bob = Person({name: 'Bob'}) // *new* is unneeded so that you can
// replace classes with factory functions.
// Every class has a 'type', so that you can create the object through
// a json blob:
bob = Tea.create({type: 'person', name: 'Bob'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment