Skip to content

Instantly share code, notes, and snippets.

@colinsullivan
Created June 7, 2011 03:57
Show Gist options
  • Save colinsullivan/1011663 to your computer and use it in GitHub Desktop.
Save colinsullivan/1011663 to your computer and use it in GitHub Desktop.
Sample OO programming
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