Skip to content

Instantly share code, notes, and snippets.

@TechnotronicOz
Created January 28, 2013 18:47
Show Gist options
  • Save TechnotronicOz/4658000 to your computer and use it in GitHub Desktop.
Save TechnotronicOz/4658000 to your computer and use it in GitHub Desktop.
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