Skip to content

Instantly share code, notes, and snippets.

@solenoid
Forked from rfreedman/gist:1214540
Created September 13, 2011 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save solenoid/1215114 to your computer and use it in GitHub Desktop.
Save solenoid/1215114 to your computer and use it in GitHub Desktop.
modified Mammal CoffeeScript example
class Mammal
constructor: (@species, @defining_char) ->
print: ->
"Hello I'm a #{@species}. I have #{@defining_char}."
cat = new Mammal('cat', 'claws')
alert(cat.print())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment