Skip to content

Instantly share code, notes, and snippets.

@hookercookerman
Created September 20, 2011 13:03
Show Gist options
  • Save hookercookerman/1229024 to your computer and use it in GitHub Desktop.
Save hookercookerman/1229024 to your computer and use it in GitHub Desktop.
class of an instance attributes
class Animal
constructor: (@name) ->
move: (meters) ->
console.log @name + " moved #{meters}m."
class Snake extends Animal
@beans: ->
console.log("I eat beans")
move: ->
Snake.beans()
super 5
snake = new Snake
snake.move()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment