Skip to content

Instantly share code, notes, and snippets.

@phpnode
Created November 4, 2012 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpnode/4013933 to your computer and use it in GitHub Desktop.
Save phpnode/4013933 to your computer and use it in GitHub Desktop.
class AutoWhat
constructor: ->
console.log "constructing"
foo: => console.log this
window["whatever"] = ->
AutoWhat::constructor.apply this, arguments
for attr, val of AutoWhat::
window["whatever"]::[attr] = val
b = new whatever
console.log b
b.foo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment