From 1e3eeafc01e529992c75eb3a8b7387881aa0b6c6 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Thu, 3 Feb 2022 12:54:51 +0100 Subject: [PATCH] Removed unneeded db class --- src/database.rb | 18 +++++------------- src/db/main.db | 0 2 files changed, 5 insertions(+), 13 deletions(-) create mode 100644 src/db/main.db diff --git a/src/database.rb b/src/database.rb index 99f7870..426deb3 100644 --- a/src/database.rb +++ b/src/database.rb @@ -1,15 +1,7 @@ -DEFAULT_DB_PATH = "db/database.db" +DEFAULT_DB_PATH = "db/main.db" -class Database - attr_reader :name, :db_path - def initialize(name, db_path=DEFAULT_DB_PATH) - @name = name - @db_path = db_path - end - - def get_handle - db = SQLite3::Database.new @db_path - db.results_as_hash = true - return db - end +def db_handle + db = SQLite3::Database.new DEFAULT_DB_PATH + db.results_as_hash = true + return db end diff --git a/src/db/main.db b/src/db/main.db new file mode 100644 index 0000000..e69de29