From 737063651a31b05631fbb3fae5803da5db0ee389 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Mon, 2 Dec 2019 10:54:41 -0500 Subject: Fix Ingredients as array in recipe --- recipeBuddy/src/app/DataModels/ingredient.spec.ts | 7 ++++++ recipeBuddy/src/app/DataModels/ingredient.ts | 29 ++++++++++++++++++++++ recipeBuddy/src/app/DataModels/ingredients.spec.ts | 7 ------ recipeBuddy/src/app/DataModels/ingredients.ts | 29 ---------------------- recipeBuddy/src/app/DataModels/recipe.ts | 2 +- 5 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 recipeBuddy/src/app/DataModels/ingredient.spec.ts create mode 100644 recipeBuddy/src/app/DataModels/ingredient.ts delete mode 100644 recipeBuddy/src/app/DataModels/ingredients.spec.ts delete mode 100644 recipeBuddy/src/app/DataModels/ingredients.ts diff --git a/recipeBuddy/src/app/DataModels/ingredient.spec.ts b/recipeBuddy/src/app/DataModels/ingredient.spec.ts new file mode 100644 index 0000000..17b5858 --- /dev/null +++ b/recipeBuddy/src/app/DataModels/ingredient.spec.ts @@ -0,0 +1,7 @@ +import { Ingredients } from './ingredients'; + +describe('Ingredients', () => { + it('should create an instance', () => { + expect(new Ingredients()).toBeTruthy(); + }); +}); diff --git a/recipeBuddy/src/app/DataModels/ingredient.ts b/recipeBuddy/src/app/DataModels/ingredient.ts new file mode 100644 index 0000000..0ede1d1 --- /dev/null +++ b/recipeBuddy/src/app/DataModels/ingredient.ts @@ -0,0 +1,29 @@ +export class Ingredient { + private name: string; + private amount: number; + private unit: string; + private type_: string; + + public constructor(name: string, amount: number, unit: string, type_: string) { + this.name = names; + this.amount = amount; + this.unit = unit; + this.type_ = type_; + } + + public getName(): string { + return this.name; + } + + public getAmount(): number { + return this.amount; + } + + public getUnit(): string { + return this.unit; + } + + public getType(): string { + return this.type_; + } +} diff --git a/recipeBuddy/src/app/DataModels/ingredients.spec.ts b/recipeBuddy/src/app/DataModels/ingredients.spec.ts deleted file mode 100644 index 17b5858..0000000 --- a/recipeBuddy/src/app/DataModels/ingredients.spec.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Ingredients } from './ingredients'; - -describe('Ingredients', () => { - it('should create an instance', () => { - expect(new Ingredients()).toBeTruthy(); - }); -}); diff --git a/recipeBuddy/src/app/DataModels/ingredients.ts b/recipeBuddy/src/app/DataModels/ingredients.ts deleted file mode 100644 index 6f96e69..0000000 --- a/recipeBuddy/src/app/DataModels/ingredients.ts +++ /dev/null @@ -1,29 +0,0 @@ -export class Ingredients { - private names: string[]; - private amounts: number[]; - private units: string[]; - private types: string[]; - - public constructor(names: string[], amounts: number[], units: string[], types: string[]) { - this.names = names; - this.amounts = amounts; - this.units = units; - this.types = types; - } - - public getNames(): string[] { - return this.names; - } - - public getAmounts(): number[] { - return this.amounts; - } - - public getUnits(): string[] { - return this.units; - } - - public getTypes(): string[] { - return this.types; - } -} diff --git a/recipeBuddy/src/app/DataModels/recipe.ts b/recipeBuddy/src/app/DataModels/recipe.ts index 82e4a73..7ca7421 100644 --- a/recipeBuddy/src/app/DataModels/recipe.ts +++ b/recipeBuddy/src/app/DataModels/recipe.ts @@ -5,7 +5,7 @@ export class Recipe { private id: number; private name: string; private description: string; - private ingredients: Ingredients; + private ingredients: Ingredient[]; private steps: Steps; private servingSize: number; private cookTime: number; -- cgit v1.1