Class: ScormEngine::Configuration
- Inherits:
-
Object
- Object
- ScormEngine::Configuration
- Defined in:
- lib/scorm_engine/configuration.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Legacy v1 API: rustici-docs.s3.amazonaws.com/engine/2017.1.x/api.html Latest v2 API: rustici-docs.s3.amazonaws.com/engine/20.1.x/api/apiV2.html.
- #log_options ⇒ Object
- #logger ⇒ Object
- #password ⇒ Object
-
#path_prefix ⇒ Object
Legacy v1 API: rustici-docs.s3.amazonaws.com/engine/2017.1.x/api.html Latest v2 API: rustici-docs.s3.amazonaws.com/engine/20.1.x/api/apiV2.html.
-
#protocol ⇒ Object
Legacy v1 API: rustici-docs.s3.amazonaws.com/engine/2017.1.x/api.html Latest v2 API: rustici-docs.s3.amazonaws.com/engine/20.1.x/api/apiV2.html.
- #username ⇒ Object
-
#v2_path_prefix ⇒ Object
Legacy v1 API: rustici-docs.s3.amazonaws.com/engine/2017.1.x/api.html Latest v2 API: rustici-docs.s3.amazonaws.com/engine/20.1.x/api/apiV2.html.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 |
# File 'lib/scorm_engine/configuration.rb', line 24 def initialize reset end |
Instance Attribute Details
#host ⇒ Object
Legacy v1 API: rustici-docs.s3.amazonaws.com/engine/2017.1.x/api.html Latest v2 API: rustici-docs.s3.amazonaws.com/engine/20.1.x/api/apiV2.html
15 16 17 |
# File 'lib/scorm_engine/configuration.rb', line 15 def host @host end |
#log_options ⇒ Object
22 23 24 |
# File 'lib/scorm_engine/configuration.rb', line 22 def @log_options end |
#logger ⇒ Object
22 23 24 |
# File 'lib/scorm_engine/configuration.rb', line 22 def logger @logger end |
#password ⇒ Object
18 19 20 |
# File 'lib/scorm_engine/configuration.rb', line 18 def password @password end |
#path_prefix ⇒ Object
Legacy v1 API: rustici-docs.s3.amazonaws.com/engine/2017.1.x/api.html Latest v2 API: rustici-docs.s3.amazonaws.com/engine/20.1.x/api/apiV2.html
15 16 17 |
# File 'lib/scorm_engine/configuration.rb', line 15 def path_prefix @path_prefix end |
#protocol ⇒ Object
Legacy v1 API: rustici-docs.s3.amazonaws.com/engine/2017.1.x/api.html Latest v2 API: rustici-docs.s3.amazonaws.com/engine/20.1.x/api/apiV2.html
15 16 17 |
# File 'lib/scorm_engine/configuration.rb', line 15 def protocol @protocol end |
#username ⇒ Object
18 19 20 |
# File 'lib/scorm_engine/configuration.rb', line 18 def username @username end |
#v2_path_prefix ⇒ Object
Legacy v1 API: rustici-docs.s3.amazonaws.com/engine/2017.1.x/api.html Latest v2 API: rustici-docs.s3.amazonaws.com/engine/20.1.x/api/apiV2.html
15 16 17 |
# File 'lib/scorm_engine/configuration.rb', line 15 def v2_path_prefix @v2_path_prefix end |
Instance Method Details
#reset ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# 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 |