Class: ProconBypassMan::Web::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/web/configuration.rb

Defined Under Namespace

Modules: ClassAttributes

Instance Method Summary collapse

Instance Method Details

#db_pathString

Returns:

  • (String)


35
36
37
# File 'lib/procon_bypass_man/web/configuration.rb', line 35

def db_path
  @db_path ||= ENV["DB_PATH"] || File.join(root, "pbm_web.db")
end

#loggerLogger

Returns:

  • (Logger)


17
18
19
# File 'lib/procon_bypass_man/web/configuration.rb', line 17

def logger
  @logger || Logger.new(nil)
end

#logger=(logger) ⇒ Object



21
22
23
# File 'lib/procon_bypass_man/web/configuration.rb', line 21

def logger=(logger)
  @logger = logger
end

#rootString

Returns:

  • (String)


26
27
28
# File 'lib/procon_bypass_man/web/configuration.rb', line 26

def root
  @root || File.expand_path('../..', __dir__).freeze
end

#root=(path) ⇒ Object



30
31
32
# File 'lib/procon_bypass_man/web/configuration.rb', line 30

def root=(path)
  @root = path
end