How to document a function generator with jsdoc?

Viewed 711

I am trying to document a function generator but without success, this is an example:

function genericObjectGenerator(tagname) {
  var specificObject = function () {};

  specificObject.getClassName = function () {
    return tagname;
  }

  specificObject.prototype.sayHello = function(name) {
    return tagname + " says hello to " + name;
  }

  return specificObject;
}

var MyObject = genericObjectGenerator("object1");

var myObjectInstance = new MyObject();

myObjectInstance.sayHello();

How should i document the genericObjectGenerator and its specificObject functions in order to get JSDoc (and IntelliJ) to resolve the sayHello properly.

1 Answers
Related