Bona Iqiniso Application Board

V3BiInfluenceArray

Specification for V3BiInfluenceArray

Attributes

AttributeTypeDescription
itemsV3BiInfluenceBase[]Array of influence base items

Methods

MethodDescription
constructorInitializes a new instance of V3BiInfluenceArray with the provided items array.
getInfluencerByLanguageReturns the influence description in the specified language for a given influencer, or ‘undefined stakeholder’ if not found.

Constructor

Signature:

constructor(items: V3BiInfluenceBase[])

Parameters:

  • items (V3BiInfluenceBase[]): Array of influence base items.

Description:
The constructor initializes the V3BiInfluenceArray instance with the provided items array.

Method: getInfluencerByLanguage

Signature:

getInfluencerByLanguage(influencer: string, language: string): string

Parameters:

  • influencer (string): The name or identifier of the influencer.
  • language (string): The language code for which the influencer’s description is requested.

Description:
Returns the influence description in the specified language for a given influencer. If the influencer is not found, it returns ‘undefined stakeholder’.

Example Usage

const influences = [
  new V3BiInfluenceBase('influencer1', 'en', 'Influencer description in English'),
  new V3BiInfluenceBase('influencer2', 'es', 'Descripción del influencer en español')
];
const influenceArray = new V3BiInfluenceArray(influences);
console.log(influenceArray.getInfluencerByLanguage('influencer1', 'en')); // Output: Influencer description in English
console.log(influenceArray.getInfluencerByLanguage('influencer3', 'fr')); // Output: undefined stakeholder

Scenario Table

ScenarioGivenWhenThen
Create an instance with provided itemsThe items array contains valid V3BiInfluenceBase objectsI create a new V3BiInfluenceArray with itemsThe instance should be created with the specified items
Return the correct influence description for a given influencer and languageThe items array contains valid V3BiInfluenceBase objectsI call getInfluencerByLanguage with a valid influencer and languageThe correct influence description for the given influencer and language should be returned
Return “undefined stakeholder” if the influencer does not existThe items array contains valid V3BiInfluenceBase objectsI call getInfluencerByLanguage with an invalid influencer or languageThe message ‘undefined stakeholder’ should be returned

Overview Table

AttributeTypeDescription
itemsV3BiInfluenceBase[]Array of influence base items
MethodDescription
constructorInitializes a new instance of V3BiInfluenceArray with the provided items array.
getInfluencerByLanguageReturns the influence description in the specified language for a given influencer, or ‘undefined stakeholder’ if not found.

This setup ensures that the V3BiInfluenceArray class is correctly instantiated and that its methods function as expected under various scenarios.