Class: ScormEngine::Models::TenantConfiguration
- Defined in:
- lib/scorm_engine/models/tenant_configuration.rb
Instance Attribute Summary collapse
Class Method Summary collapse
-
.get_settings_from_api(options = {}) ⇒ Hash
Extract and normalize the settings from the API options.
- .new_from_api(options = {}) ⇒ Object
Methods inherited from Base
Instance Attribute Details
#settings ⇒ Hash
7 8 9 |
# File 'lib/scorm_engine/models/tenant_configuration.rb', line 7 def settings @settings end |
Class Method Details
.get_settings_from_api(options = {}) ⇒ Hash
Extract and normalize the settings from the API options.
26 27 28 29 30 31 |
# File 'lib/scorm_engine/models/tenant_configuration.rb', line 26 def self.get_settings_from_api( = {}) ["configurationItems"].reduce({}) do |m, o| m[o["id"]] = o["value"] m end end |
.new_from_api(options = {}) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/scorm_engine/models/tenant_configuration.rb', line 9 def self.new_from_api( = {}) this = new this. = .dup this.settings = get_settings_from_api() this end |