Created
January 27, 2011 03:16
-
-
Save devrim/798000 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
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