Skip to content

Instantly share code, notes, and snippets.

@rfreedman
Created September 13, 2011 18:07
Show Gist options
  • Save rfreedman/1214540 to your computer and use it in GitHub Desktop.
Save rfreedman/1214540 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