Skip to content

Instantly share code, notes, and snippets.

@airportyh
Created February 27, 2013 17:14
Show Gist options
  • Save airportyh/5049664 to your computer and use it in GitHub Desktop.
Save airportyh/5049664 to your computer and use it in GitHub Desktop.
CanSing =
sing: ->
console.log "I am #{@name} la la la"
include = (ctr, mixin) ->
for key of mixin
ctr.prototype[key] = mixin[key]
class Man
include(Man, CanSing)
constructor: (@name) ->
brian = new Man('Brian')
brian.sing()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment