Module: ScormEngine::Api::Endpoints::Configuration
- Included in:
- ScormEngine::Api::Endpoints
- Defined in:
- lib/scorm_engine/api/endpoints/configuration.rb
Instance Method Summary collapse
-
#delete_app_configuration(options = {}) ⇒ ScormEngine::Response
Deletes the current value for a setting, reverting it to its default value.
-
#get_app_configuration(options = {}) ⇒ ScormEngine::Response
Get the application settings currently configured in Engine.
-
#post_app_configuration(options = {}) ⇒ ScormEngine::Response
Set one or more application settings in Engine.
Instance Method Details
#delete_app_configuration(options = {}) ⇒ ScormEngine::Response
Deletes the current value for a setting, reverting it to its default value.
80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/scorm_engine/api/endpoints/configuration.rb', line 80 def delete_app_configuration( = {}) (, :setting_id) api_v2(without_tenant: !.fetch(:for_tenant, false)) do setting_id = .delete(:setting_id) response = delete("appManagement/configuration/#{setting_id}") Response.new(raw_response: response) end end |
#get_app_configuration(options = {}) ⇒ ScormEngine::Response
Get the application settings currently configured in Engine.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/scorm_engine/api/endpoints/configuration.rb', line 18 def get_app_configuration( = {}) api_v2(without_tenant: !.fetch(:for_tenant, false)) do .delete(:for_tenant) response = get("appManagement/configuration", ) result = OpenStruct.new response.body["settingItems"].each do |setting| result[setting["id"]] = setting["effectiveValue"] end Response.new(raw_response: response, result: result) end end |
#post_app_configuration(options = {}) ⇒ ScormEngine::Response
Set one or more application settings in Engine.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/scorm_engine/api/endpoints/configuration.rb', line 50 def post_app_configuration( = {}) (, :settings) api_v2(without_tenant: !.fetch(:for_tenant, false)) do settings = .delete(:settings) body = { settings: settings.map { |k, v| { "settingId" => k, "value" => v.to_s } } } response = post("appManagement/configuration", {}, body) Response.new(raw_response: response) end end |