class ScormEngine::Configuration

Attributes

Public Class Methods

new() click to toggle source
# File lib/scorm_engine/configuration.rb, line 24
def initialize
  reset
end

Public Instance Methods

reset() click to toggle source
# File lib/scorm_engine/configuration.rb, line 28
def reset
  @protocol = ENV.fetch("SCORM_ENGINE_PROTOCOL", "https")
  @host = ENV["SCORM_ENGINE_HOST"]
  @path_prefix = ENV.fetch("SCORM_ENGINE_PATH_PREFIX", "/ScormEngineInterface/api/v1/")
  @v2_path_prefix = ENV.fetch("SCORM_ENGINE_V2_PATH_PREFIX", "/ScormEngineInterface/api/v2/")

  @username = ENV["SCORM_ENGINE_USERNAME"]
  @password = ENV["SCORM_ENGINE_PASSWORD"]

  @logger = ::Logger.new(ENV.fetch("SCORM_ENGINE_LOGFILE", "/dev/null"))

  @log_options = begin
    JSON.parse(ENV.fetch("SCORM_ENGINE_LOG_OPTIONS"))
  rescue KeyError, JSON::ParserError
    { headers: false, bodies: false }
  end
end