Domanda

I'm writing documentation with yuidoc. However, I have a class Model, which has one of its methods defined elsewhere. Here is some code to visualize the situation. Assume I have a file model.js:

/**
 * @class Model
 * @constructor
 */
 window.Model = function(){}
 ....

And a file activerecord.js:

(function(){
    /**
     * @class ActiveRecord
     * @constructor
     window.ActiveRecord = function(){}
     ....
     /**
      * @method Model.hasMany
      * @param {Class} model
      */
     function hasMany(model) {}
})() ;

As you can see, the method 'hasMany' should show up under the class documentation of Model. However, it doesn't. Is something like this possible ?

Thanks a lot

È stato utile?

Soluzione

See the @for tag: http://yui.github.io/yuidoc/syntax/index.html#for

/**  
 * Some method "hasMany" disconnected from its class "Model".
 * 
 * @method hasMany  
 * @for Model
 * @param {Class} model 
 */
function hasMany(model) {}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top