class ScormEngine::Models::CourseConfiguration
Attributes
settings[RW]
@attr
@return [Hash]
Public Class Methods
get_settings_from_api(options = {})
click to toggle source
Extract and normalize the settings from the API options.
@param [Hash] options
The API options hash
@return [Hash]
A hash of key/value pairs.
# File lib/scorm_engine/models/course_configuration.rb, line 26 def self.get_settings_from_api(options = {}) options["configurationItems"].reduce({}) do |m, o| m[o["id"]] = o["value"] m end end
new_from_api(options = {})
click to toggle source
# File lib/scorm_engine/models/course_configuration.rb, line 9 def self.new_from_api(options = {}) this = new this.options = options.dup this.settings = get_settings_from_api(options) this end