master
E. Almqvist 3 years ago
parent 4c4fbf2a4c
commit a8f5e9d548
  1. 1
      .gitignore
  2. 9
      src/database.rb
  3. BIN
      src/db/main.db

1
.gitignore vendored

@ -0,0 +1 @@
src/db/

@ -5,7 +5,8 @@ require_relative "db_models.rb"
class Table class Table
attr_reader :name attr_reader :name
attr_accessor :db attr_accessor :db
def initialize(db, name)
def initialize(db, name, sql_file)
@db = db @db = db
@name = name @name = name
end end
@ -13,12 +14,12 @@ end
class Database # Database class class Database # Database class
attr_reader :name, :path attr_reader :name, :path
def initialize(name, table_structure, db_path=DEFAULT_DB_PATH) attr_accessor :tables
def initialize(name, tables_names=[], db_path=DEFAULT_DB_PATH)
@name = name @name = name
@path = db_path @path = db_path
# generate table_structure if it doesn't exist
@tables = {} @tables = []
# generate table objects # generate table objects
end end

Binary file not shown.
Loading…
Cancel
Save