Created
January 19, 2013 22:37
-
-
Save DeadWisdom/4575639 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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