Created
June 7, 2011 03:57
-
-
Save colinsullivan/1011663 to your computer and use it in GitHub Desktop.
Sample OO programming
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
class Provider extends Backbone.Atlas.Model | |
user_check_in: (user) -> | |
console.log 'user checked in' | |
class CoffeeShop extends Provider | |
user_check_in: (user) -> | |
super user | |
console.log 'give user menu' | |
class Theater extends Provider | |
user_check_in: (user) -> | |
super user | |
console.log 'give user tickets' | |
myUser = {name: 'Craig'} | |
myTheater = new Theater() | |
myCoffeeShop = new CoffeeShop() | |
console.log 'checking into theater' | |
myTheater.user_check_in(myUser) | |
console.log 'checking into coffeeshop' | |
myCoffeeShop.user_check_in(myUser) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment