Skip to content

Instantly share code, notes, and snippets.

@devrim
Created January 27, 2011 03:16
Show Gist options
  • Save devrim/798000 to your computer and use it in GitHub Desktop.
Save devrim/798000 to your computer and use it in GitHub Desktop.
class @kdApi
constructor : (className,funcName) ->
data = @runFunction(className,funcName,data)
getInstance : (className) ->
inst = false
try if eval(className) then inst = eval("new "+className+"()")
return inst
runFunction : (className,funcName,data) ->
instance = @getInstance(className)
instance[funcName](data) if instance and instance[funcName]?
return instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment