API Docs for: 0.9.3
Show:

File: lib/taskDecorator/identifier.js

  1. // Copyright 2014, Yahoo! Inc.
  2. // Copyrights licensed under the Mit License. See the accompanying LICENSE file for terms.
  3.  
  4. var AbstractTaskDecorator = require('../abstractTaskDecorator');
  5.  
  6. /**
  7. * @class IdentifierTaskDecorator
  8. * @extends AbstractTaskDecorator
  9. * @constructor
  10. *
  11. * @property {Driver} _instance
  12. */
  13. var IdentifierTaskDecorator = AbstractTaskDecorator.extend(
  14.  
  15. {
  16. /**
  17. * Run the decorator
  18. *
  19. * @method run
  20. * @param {object} taskOptions
  21. * @param {int} taskIndex
  22. */
  23. run: function (taskOptions, taskIndex) {
  24.  
  25. taskOptions.taskId = "task_" + taskIndex;
  26. if (!taskOptions.name) {
  27. taskOptions.name = taskOptions.taskId;
  28. }
  29. if (!taskOptions.title) {
  30. taskOptions.title = taskOptions.name;
  31. }
  32. }
  33. });
  34.  
  35. module.exports = IdentifierTaskDecorator;
  36.