From 702f7383cb43e9691c65d704d620798378dbcbbc Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Sat, 2 May 2020 21:07:15 +0200 Subject: [PATCH] implement abstracts --- lib/DatabaseModel.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/DatabaseModel.ts b/lib/DatabaseModel.ts index 3383ee4..9f29462 100644 --- a/lib/DatabaseModel.ts +++ b/lib/DatabaseModel.ts @@ -24,8 +24,13 @@ export abstract class DatabaseModel { this.id = id; } - public abstract get(key: string): string|number|boolean; - public abstract set(key: string, value: string|number|boolean): void; + public get (key: string): string|number|boolean { + return this.data[key]; + } + + public set (key: string, value: string|number|boolean): void { + this.data[key] = value; + } public abstract async read(): Promise; public abstract async write(): Promise;