Module: ScormEngine::Faraday::Connection

Included in:
Client
Defined in:
lib/scorm_engine/faraday/connection.rb

Instance Method Summary collapse

Instance Method Details

#base_uri(version: 1) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/scorm_engine/faraday/connection.rb', line 8

def base_uri(version: 1)
  uri = URI("")
  uri.scheme = ScormEngine.configuration.protocol
  uri.host = ScormEngine.configuration.host

  uri.path = if version == 2
               ScormEngine.configuration.v2_path_prefix
             else
               ScormEngine.configuration.path_prefix
             end

  URI(uri.to_s) # convert URI::Generic to URI:HTTPS
end