Last active
December 11, 2015 10:39
-
-
Save occ/4588575 to your computer and use it in GitHub Desktop.
This file contains 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
var ShieldJS = function(options) { | |
// Private variables | |
var alphabetically, | |
ordered, | |
var1, | |
var2; | |
// Construtor | |
function constructor(o) { | |
// Process options, etc. | |
}(options); | |
// Internal functions | |
var doSomething = function() { | |
}; | |
// Public functions and getters/setters | |
var getVar1 = function() { | |
return var1; | |
}; | |
var setVar1 = function(v) { | |
var1 = v; | |
}; | |
var sayHello = function(name) { | |
return "Hello, " + name; | |
}; | |
return { | |
getVar1: getVar1, | |
setVar1: setVar1, | |
sayHello: sayHello | |
} | |
} | |
var s = new ShieldJS(); | |
var greeting = s.sayHello("occ"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How would we test internal functions? Should we?