Created
April 3, 2011 17:18
-
-
Save DveMac/900580 to your computer and use it in GitHub Desktop.
base class
This file contains 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 Animal | |
_eating = false | |
constructor: -> | |
# some stuff | |
dolunch: -> | |
if not _eating | |
eatWithCallback 'sandwich', ()-> | |
sys.puts 'yum' | |
_eating = false | |
eatWithCallback: (food, cb)-> | |
# override me |
This file contains 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 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