summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-12-02 19:48:15 -0500
committerTucker Evans <tuckerevans24@gmail.com>2019-12-02 19:57:35 -0500
commitf94d81c5283cbf5be2f2a96faa21807e381e1c5c (patch)
treeb8400e597075df46446f1772fc4594f824548dda
parentdaf0ba705ff8692e83e8343778bc34cbc93beff3 (diff)
Fix typos in DataModels
Mostly variable name fixes and type fixes. Also delete unused DataModels
-rw-r--r--recipeBuddy/src/app/DataModels/ingredient.ts2
-rw-r--r--recipeBuddy/src/app/DataModels/ingredients.spec.ts7
-rw-r--r--recipeBuddy/src/app/DataModels/ingredients.ts29
-rw-r--r--recipeBuddy/src/app/DataModels/recipe.ts12
-rw-r--r--recipeBuddy/src/app/DataModels/step.ts2
-rw-r--r--recipeBuddy/src/app/DataModels/steps.spec.ts7
-rw-r--r--recipeBuddy/src/app/DataModels/steps.ts18
7 files changed, 8 insertions, 69 deletions
diff --git a/recipeBuddy/src/app/DataModels/ingredient.ts b/recipeBuddy/src/app/DataModels/ingredient.ts
index 0ede1d1..c79b475 100644
--- a/recipeBuddy/src/app/DataModels/ingredient.ts
+++ b/recipeBuddy/src/app/DataModels/ingredient.ts
@@ -5,7 +5,7 @@ export class Ingredient {
private type_: string;
public constructor(name: string, amount: number, unit: string, type_: string) {
- this.name = names;
+ this.name = name;
this.amount = amount;
this.unit = unit;
this.type_ = 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 3194adc..368f237 100644
--- a/recipeBuddy/src/app/DataModels/recipe.ts
+++ b/recipeBuddy/src/app/DataModels/recipe.ts
@@ -1,5 +1,5 @@
-import {Steps} from "./steps"
-import {Ingredients} from "./ingredients"
+import {Step} from "./step"
+import {Ingredient} from "./ingredient"
export class Recipe {
private id: number;
@@ -14,7 +14,7 @@ export class Recipe {
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[]) {
+ public constructor(id: number, name: string, description: string, ingredients: Ingredient[], steps: Step[], servingSize: number, cookTime: number, rating: number, tags: string[]) {
this.id = id;
this.name = name;
this.description = description;
@@ -38,11 +38,11 @@ export class Recipe {
return this.description;
}
- public getIngredients(): Ingredients {
+ public getIngredients(): Ingredient[] {
return this.ingredients;
}
- public getSteps(): Steps {
+ public getSteps(): Step[] {
return this.steps;
}
@@ -55,7 +55,7 @@ export class Recipe {
}
public getTimesCooked(): number {
- return timesCooked;
+ return this.timesCooked;
}
public getRating(): number {
return this.rating;
diff --git a/recipeBuddy/src/app/DataModels/step.ts b/recipeBuddy/src/app/DataModels/step.ts
index 674a6df..1c1ca7b 100644
--- a/recipeBuddy/src/app/DataModels/step.ts
+++ b/recipeBuddy/src/app/DataModels/step.ts
@@ -1,4 +1,4 @@
-export class Steps {
+export class Step {
private instruction: string;
private timer: number;
diff --git a/recipeBuddy/src/app/DataModels/steps.spec.ts b/recipeBuddy/src/app/DataModels/steps.spec.ts
deleted file mode 100644
index e315565..0000000
--- a/recipeBuddy/src/app/DataModels/steps.spec.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { Steps } from './steps';
-
-describe('Steps', () => {
- it('should create an instance', () => {
- expect(new Steps()).toBeTruthy();
- });
-});
diff --git a/recipeBuddy/src/app/DataModels/steps.ts b/recipeBuddy/src/app/DataModels/steps.ts
deleted file mode 100644
index 9061dc2..0000000
--- a/recipeBuddy/src/app/DataModels/steps.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export class Steps {
- private instructions: string[];
- private timers: number[];
-
- public contructor(instructions: string[], timers: number[]) {
- this.instructions = instructions;
- this.timers = timers;
- }
-
- public getInstructions(): string[] {
- return this.instructions;
- }
-
- public getTimers(): number[] {
- return this.timers;
- }
-
-}