Add getDishTitle function

This commit is contained in:
j433866 2019-06-13 09:43:58 +01:00
parent f497dc3170
commit 6ee76e3bf0
5 changed files with 102 additions and 3 deletions

View file

@ -168,6 +168,18 @@ class Chef {
return await newDish.get(type);
}
/**
* Gets the title of a dish and returns it
*
* @param {Dish} dish
* @param {number} [maxLength=100]
* @returns {string}
*/
async getDishTitle(dish, maxLength=100) {
const newDish = new Dish(dish);
return await newDish.getTitle(maxLength);
}
}
export default Chef;