|
|
@ -1,15 +1,7 @@ |
|
|
|
DEFAULT_DB_PATH = "db/database.db" |
|
|
|
DEFAULT_DB_PATH = "db/main.db" |
|
|
|
|
|
|
|
|
|
|
|
class Database |
|
|
|
def db_handle |
|
|
|
attr_reader :name, :db_path |
|
|
|
db = SQLite3::Database.new DEFAULT_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 |
|
|
|
db.results_as_hash = true |
|
|
|
return db |
|
|
|
return db |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|