Created
May 28, 2012 19:11
-
-
Save whalesalad/2820753 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
| (function() { | |
| var User; | |
| User = (function() { | |
| function User(user_data) { | |
| this.name = user_data.your_name; | |
| this.email = user_data.your_email; | |
| this.has_facebook = user_data.has_facebook; | |
| this.age = user_data.your_age; | |
| this.ratings = {}; | |
| console.log("<New User: " + this.name + ", " + this.email + ">"); | |
| } | |
| User.prototype.get_first_name = function() { | |
| return this.name.split(' ')[0]; | |
| }; | |
| User.prototype.get_serialized = function() { | |
| return { | |
| name: this.name, | |
| email: this.email, | |
| facebook: this.has_facebook, | |
| age: this.age, | |
| ratings: this.ratings | |
| }; | |
| }; | |
| return User; | |
| })(); | |
| window.User = User; | |
| }).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment