Skip to content

Instantly share code, notes, and snippets.

@jlsync
Forked from hookercookerman/beans
Created September 20, 2011 13:05
Show Gist options
  • Save jlsync/1229025 to your computer and use it in GitHub Desktop.
Save jlsync/1229025 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: ->
@constructor.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