Skip to content

Instantly share code, notes, and snippets.

@thejh
Forked from DveMac/Lion class
Created April 3, 2011 17:36
Show Gist options
  • Save thejh/900597 to your computer and use it in GitHub Desktop.
Save thejh/900597 to your computer and use it in GitHub Desktop.
class Animal
_eating = false
constructor: ->
@_eating = false
# some stuff
dolunch: ->
if not @_eating
eatWithCallback 'sandwich', ()->
sys.puts 'yum'
@_eating = false
eatWithCallback: (food, cb)->
# override me
class Lion extends Animal
eat: (food, cb)->
cb()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment