/tags/jsdoc_toolkit-2.4.0/jsdoc-toolkit/app/test/multi_methods.js

http://jsdoc-toolkit.googlecode.com/ · JavaScript · 25 lines · 5 code · 1 blank · 19 comment · 5 complexity · fba33081f40ca7b6fa7f8bc4c8789635 MD5 · raw file

  1. /**
  2. Get the entire flavor.
  3. @name flavor^3
  4. @function
  5. @returns {Object} The entire flavor hash.
  6. */
  7. /**
  8. Get a named flavor.
  9. @name flavor^2
  10. @function
  11. @param {String} name The name of the flavor to get.
  12. @returns {String} The value of that flavor.
  13. */
  14. /**
  15. Set the flavor.
  16. @param {String} name The name of the flavor to set.
  17. @param {String} value The value of the flavor.
  18. @returns {String} The value of that flavor.
  19. */
  20. function flavor(name, value) {
  21. if (arguments.length > 1) flavor[name] = value;
  22. else if (arguments.length == 1) return flavor[name];
  23. else return flavor;
  24. }