diff options
Diffstat (limited to 'recipeBuddy/src')
-rw-r--r-- | recipeBuddy/src/app/DataModels/ingredient.spec.ts | 7 | ||||
-rw-r--r-- | recipeBuddy/src/app/DataModels/ingredient.ts | 29 | ||||
-rw-r--r-- | recipeBuddy/src/app/DataModels/recipe.ts | 15 | ||||
-rw-r--r-- | recipeBuddy/src/app/DataModels/step.spec.ts | 7 | ||||
-rw-r--r-- | recipeBuddy/src/app/DataModels/step.ts | 18 |
5 files changed, 73 insertions, 3 deletions
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/recipe.ts b/recipeBuddy/src/app/DataModels/recipe.ts index 82e4a73..3194adc 100644 --- a/recipeBuddy/src/app/DataModels/recipe.ts +++ b/recipeBuddy/src/app/DataModels/recipe.ts @@ -5,12 +5,14 @@ export class Recipe { private id: number; private name: string; private description: string; - private ingredients: Ingredients; - private steps: Steps; + private ingredients: Ingredient[]; + private steps: Step[]; private servingSize: number; private cookTime: number; + private timesCooked: number; private rating: number; private tags: string[]; + private photos: string[]; public constructor(id: number, name: string, description: string, ingredients: Ingredients, steps: Steps, servingSize: number, cookTime: number, rating: number, tags: string[]) { this.id = id; @@ -51,7 +53,10 @@ export class Recipe { public getCookTime(): number { return this.cookTime; } - + + public getTimesCooked(): number { + return timesCooked; + } public getRating(): number { return this.rating; } @@ -59,4 +64,8 @@ export class Recipe { public getTags(): string[] { return this.tags; } + + public getPhotos(): string[] { + return this.photos; + } } diff --git a/recipeBuddy/src/app/DataModels/step.spec.ts b/recipeBuddy/src/app/DataModels/step.spec.ts new file mode 100644 index 0000000..e315565 --- /dev/null +++ b/recipeBuddy/src/app/DataModels/step.spec.ts @@ -0,0 +1,7 @@ +import { Steps } from './steps'; + +describe('Steps', () => { + it('should create an instance', () => { + expect(new Steps()).toBeTruthy(); + }); +}); diff --git a/recipeBuddy/src/app/DataModels/step.ts b/recipeBuddy/src/app/DataModels/step.ts new file mode 100644 index 0000000..674a6df --- /dev/null +++ b/recipeBuddy/src/app/DataModels/step.ts @@ -0,0 +1,18 @@ +export class Steps { + private instruction: string; + private timer: number; + + public contructor(instruction: string, timer: number) { + this.instruction = instruction; + this.timer = timer; + } + + public getInstruction(): string { + return this.instruction; + } + + public getTimer(): number { + return this.timer; + } + +} |