- group config/library/storage into context

This commit is contained in:
Alex Ling
2020-02-16 18:25:28 +00:00
parent d9129ad58f
commit bb936b1fa6
4 changed files with 47 additions and 34 deletions

17
src/context.cr Normal file
View File

@@ -0,0 +1,17 @@
require "./config"
require "./library"
require "./storage"
require "logger"
class Context
property config : Config
property library : Library
property storage : Storage
def initialize
@config = Config.load
@library = Library.new @config.library_path, @config.scan_interval
@storage = Storage.new @config.db_path
end
end