Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Created February 28, 2010 00:26
Show Gist options
  • Select an option

  • Save tim-smart/317081 to your computer and use it in GitHub Desktop.

Select an option

Save tim-smart/317081 to your computer and use it in GitHub Desktop.
class Base
constructor: (type) ->
@type: type
class Tower extends Base
constructor: (material) ->
super 'tower'
@material: material
describe: ->
'I am a ' + @type + ' and I am made from ' + @material
tower: new Tower 'steel'
# Prints 'I am a tower and I am made from steel'
tower.describe()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment