-
-
Save brian-mann/5049785 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CanSing = | |
sing: -> | |
console.log "I am #{@name} la la la" | |
include = (ctr, mixin) -> | |
console.log "including", ctr | |
for key of mixin | |
ctr.prototype[key] = mixin[key] | |
class Man | |
include(@, CanSing) | |
constructor: (@name) -> | |
console.log @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