multi_methods.js 581 B

12345678910111213141516171819202122232425
  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. }