/**
*@namesomeFunction
*@authorkfb
*
*Basicusage:
* var someFunction = new SomeFunction();
* someFunction.init();
*
* additionally you can use methods like someFunction.methodName();
*
* Advancedusage:
var someFunction = new SomeFunction({
"additionalOption":"thatCanOvervriteDefaults"
});
*/
function SomeFunction(opts){
var_cfg;
var_root;
//defining defaults and extending/overwriting it with inputted parameters
this.config = $.extend({
"someOption":"somevalue"
}, opts);
/*
INITIALIZE
*/
this.init = function(){
//assign_rootandconfigvariables
_root = this;
_cfg = this.config;
//somecode
}
/*
SomePrivateMethod(no"this")
*/
_somePrivateMethod = function(){
//somecode
}
/*
SomeMethod
*/
this.someMethod = function(){
//somecode
}
}
//declaration and auto initialization of someFunction
var someFunction = new SomeFunction();
someFunction.init();
Last active
January 7, 2016 10:01
-
-
Save stormwild/4518404 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment