From 2bae41eed16a65534eea4909f2d2bd91b36c92f9 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 12 Apr 2020 12:35:10 -0400 Subject: [PATCH] [+] Create courseinfo class --- src/logic/course-info.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/logic/course-info.ts diff --git a/src/logic/course-info.ts b/src/logic/course-info.ts new file mode 100644 index 0000000..8af1eef --- /dev/null +++ b/src/logic/course-info.ts @@ -0,0 +1,29 @@ + +export default class CourseInfo +{ + id_ci: number + year: number + name: string + teacher: string + level: string + courseIds: string + + courseCount: number + + /** + * Construct with a json object + * + * @param json + */ + constructor(json: any) + { + this.id_ci = json.id_ci + this.year = json.year + this.name = json.name + this.teacher = json.teacher + this.level = json.level + this.courseIds = json.courseIds + + this.courseCount = this.courseIds.split('|').length; + } +}