Skip to content

Instantly share code, notes, and snippets.

@zhusee2
Created June 10, 2014 10:10
Show Gist options
  • Save zhusee2/9e7d23aadb206b006a1e to your computer and use it in GitHub Desktop.
Save zhusee2/9e7d23aadb206b006a1e to your computer and use it in GitHub Desktop.
#=require underscore.js
class BaseClass
@concerning: (concernName, concernObj) ->
functionsToCopy = _.omit(mixin, "included", "classFunctions")
_.extend(this.prototype, functionsToCopy)
_.extend(this, concernObj.classFunctions)
if typeof concernObj.included is "function"
concernObj.included.call(concernObj, this)
Duck =
quake: -> "Quake!"
class Kamo extends BaseClass
@act: -> console.log "Acted"
@concerning "Sound", {
included: (base) ->
do base.act
quake: -> console.log "Quake!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment