Skip to content

Commit

Permalink
Document legacy Generator.extend method properly - rel #996
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Mar 5, 2017
1 parent 6d267f0 commit 74cb46f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,16 @@ Base.prototype._writeFiles = function (done) {
};

/**
* Extend this Class to create a new one inherithing this one.
* Also add a helper \_\_super__ object pointing to the parent prototypes methods
* Extend the Generator class to create a new one inherithing the base one. This
* method is useful if your environment do not suport the ES6 classes.
* @param {Object} protoProps Prototype properties (available on the instances)
* @param {Object} staticProps Static properties (available on the contructor)
* @return {Object} New sub class
* @example
* var Generator = require('yeoman-generator');
* module.exports = Generator.extend({
* writing: function () {}
* // ...
* });
*/
Base.extend = require('class-extend').extend;

0 comments on commit 74cb46f

Please sign in to comment.