module ScormEngine::Api::Endpoints::Registrations::Configuration
Public Instance Methods
Returns the effective value of every setting at this level, as well as the effective value of any setting at a more specific level.
@param [Hash] options
@option options [String] :registration_id
The ID of the registration to get.
@option options [Integer] :instance (nil)
The instance of this registration to use. If not provided, the latest instance will be used.
@return [ScormEngine::Models::RegistrationConfiguration]
# File lib/scorm_engine/api/endpoints/registrations/configuration.rb, line 28 def get_registration_configuration(options = {}) require_options(options, :registration_id) options = options.dup registration_id = options.delete(:registration_id) response = get("registrations/#{registration_id}/configuration", options) result = response.success? ? ScormEngine::Models::RegistrationConfiguration.new_from_api(response.body) : nil Response.new(raw_response: response, result: result) end
Returns the effective value for this configuration setting for the resource being configured.
@param [Hash] options
@option options [String] :registration_id
The ID of the registration to get.
@option options [String] :setting_id
The ID of the setting to get.
@option options [Integer] :instance (nil)
The instance of this registration to use. If not provided, the latest instance will be used.
@return [String]
# File lib/scorm_engine/api/endpoints/registrations/configuration.rb, line 93 def get_registration_configuration_setting(options = {}) require_options(options, :registration_id, :setting_id) options = options.dup registration_id = options.delete(:registration_id) setting_id = options.delete(:setting_id) response = get("registrations/#{registration_id}/configuration/#{setting_id}", options) result = response.success? ? response.body["value"] : nil Response.new(raw_response: response, result: result) end
Bulk set configuration settings via POST request.
@param [Hash] options
@option options [String] :registration_id
The ID of the registration to set.
@option options [Integer] :instance (nil)
The instance of this registration to use. If not provided, the latest instance will be used.
@option options [Hash] :settings
Key/value pairs of configuration options to set.
@return [ScormEngine::Response]
# File lib/scorm_engine/api/endpoints/registrations/configuration.rb, line 60 def post_registration_configuration(options = {}) require_options(options, :registration_id, :settings) options = options.dup registration_id = options.delete(:registration_id) settings = options.delete(:settings) body = { settings: settings.map { |k, v| { "settingId" => k, "value" => v.to_s } } } response = post("registrations/#{registration_id}/configuration", options, body) Response.new(raw_response: response) end
Sets the value for this configuration setting, for the resource being configured.
@param [Hash] options
@option options [String] :registration_id
The ID of the registration to set.
@option options [String] :setting_id
The ID of the setting to set.
@option options [String] :value (“”)
The value of the setting to set.
@option options [Integer] :instance (nil)
The instance of this registration to use. If not provided, the latest instance will be used.
@return [ScormEngine::Response]
# File lib/scorm_engine/api/endpoints/registrations/configuration.rb, line 129 def put_registration_configuration_setting(options = {}) require_options(options, :registration_id, :setting_id) options = options.dup registration_id = options.delete(:registration_id) setting_id = options.delete(:setting_id) body = { value: options.delete(:value).to_s } response = put("registrations/#{registration_id}/configuration/#{setting_id}", options, body) Response.new(raw_response: response) end