Permalink
Browse files

changing exports for documentation

  • Loading branch information...
1 parent 1f69e89 commit dab762e8b1edbbcd2c4872e2b8bef012e3468763 @BryanDonovan BryanDonovan committed Dec 28, 2011
Showing with 9 additions and 8 deletions.
  1. +1 −1 Makefile
  2. +8 −7 lib/horaa.js
View
@@ -10,4 +10,4 @@ lint:
doc:
./node_modules/jsdoc/app/run.js -t=./node_modules/jsdoc/templates/jsdoc -d=./doc ./lib
-.PHONY: test
+.PHONY: test doc
View
@@ -46,7 +46,7 @@ function Horaa(moduleName) {
*
* @param {string} method - existing method in the module we need to replace
* @param {string} replacement - replacement for the above method
- * @throws Error if no such method exists
+ * @throws {Error} if no such method exists
*/
this.hijack = function(method, replacement) {
@@ -65,7 +65,7 @@ function Horaa(moduleName) {
* Restore previously hijacked methods
*
* @param {string} method - name of the method we need to restore
- * @throws Error if @method was not hijacked earlier
+ * @throws {Error} if @method was not hijacked earlier
*/
this.restore = function(method) {
@@ -78,15 +78,16 @@ function Horaa(moduleName) {
};
}
-/**
- * Create a new Horaa for the @moduleName and return.
- */
var cache = {};
-module.exports = function(moduleName) {
+/**
+ * Create a new Horaa instance for @moduleName and return.
+ */
+var horaa = function(moduleName) {
if(!cache[moduleName]) {
cache[moduleName] = new Horaa(moduleName);
}
-
return cache[moduleName];
};
+
+module.exports = horaa;

0 comments on commit dab762e

Please sign in to comment.