In this example we are going to build a simple object that will show inharitence and function.
First lets define our main class.
The animal is a class used to describe general things about all animals.
class Animal
constructor: (@name, @color) ->
growl: -> console.log "#{@name} the #{@color} #{@type} goes Roar!!"
An example tiger class.
class Tiger extends Animal
constructor: ->
super
@type = "tiger"
And now here is an example on how to use these classes:
sneezy = new Tiger("Sneezy", "orange")
sneezy.growl()