Created
January 28, 2013 18:47
-
-
Save TechnotronicOz/4658000 to your computer and use it in GitHub Desktop.
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 Dog | |
constructor: (@name) -> | |
growl: -> console.log '*growl*' | |
class Yorkie extends Dog | |
constructor: (name, @tricks = []) -> | |
super name #expose name to/from parent (class Dog) | |
perform: (trick) -> console.log if trick in @tricks then "#{name} is doing #{trick}" else '*whining*' | |
growl: (person) -> | |
if person is @master | |
console.log '*bark' | |
else | |
super() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment