From 44111abf301c46c8919bbcfb66e886a176ffb099 Mon Sep 17 00:00:00 2001 From: Silke Date: Fri, 7 Jan 2022 16:33:43 +0100 Subject: [PATCH] fix: code documentation of the attribute helper class --- src/app/core/models/attribute/attribute.helper.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/core/models/attribute/attribute.helper.ts b/src/app/core/models/attribute/attribute.helper.ts index 3620ff2700..3eb80a6b57 100644 --- a/src/app/core/models/attribute/attribute.helper.ts +++ b/src/app/core/models/attribute/attribute.helper.ts @@ -2,10 +2,10 @@ import { Attribute } from './attribute.model'; export class AttributeHelper { /** - * Get a specific product attribute by attribute name. - * @param product The Product for which to get the attribute - * @param attributeName The attribute name of the attribute to get - * @returns The matching product attribute + * Gets a specific attribute by attribute name. + * @param attributes An array of attributes belonging to an object (e.g. product, basket etc.). + * @param attributeName The attribute name of the attribute to get. + * @returns The matching attribute. */ static getAttributeByAttributeName(attributes: Attribute[], attributeName: string): Attribute { if (!attributes) { @@ -15,7 +15,11 @@ export class AttributeHelper { } /** - * check if attribute is available and return value, otherwise undefined + * Gets an attribute value of an attribute within an attribute array. + * Checks if the attribute is available and returns the value, otherwise undefined. + * @param attributes An array of attributes belonging to an object (e.g. product, basket etc.). + * @param attributeName The attribute name of the appropriate attribute. + * @returns The matching attribute value. */ static getAttributeValueByAttributeName(attributes: Attribute[], attributeName: string) { const attribute = AttributeHelper.getAttributeByAttributeName(attributes, attributeName);