Class: Senkyoshi::Configuration
- Inherits:
-
Object
- Object
- Senkyoshi::Configuration
- Defined in:
- lib/senkyoshi/configuration.rb
Constant Summary collapse
- DEFAULT_TIMEOUT =
30 minutes
1_800
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#canvas_token ⇒ Object
Returns the value of attribute canvas_token.
-
#canvas_url ⇒ Object
Returns the value of attribute canvas_url.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
-
#scorm_launch_url ⇒ Object
Returns the value of attribute scorm_launch_url.
-
#scorm_oauth_consumer_key ⇒ Object
Returns the value of attribute scorm_oauth_consumer_key.
-
#scorm_shared_auth ⇒ Object
Returns the value of attribute scorm_shared_auth.
-
#scorm_shared_id ⇒ Object
Returns the value of attribute scorm_shared_id.
-
#scorm_url ⇒ Object
Returns the value of attribute scorm_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/senkyoshi/configuration.rb', line 32 def initialize @canvas_url = Configuration._config[:canvas_url] @canvas_token = Configuration._config[:canvas_token] @account_id = Configuration._config[:account_id] || :self @scorm_url = Configuration._config[:scorm_url] @scorm_launch_url = Configuration._config[:scorm_launch_url] @scorm_shared_id = Configuration._config[:scorm_shared_id] @scorm_shared_auth = Configuration._config[:scorm_shared_auth] @scorm_oauth_consumer_key = Configuration._config[:scorm_oauth_consumer_key] @request_timeout = Configuration._config[:request_timeout] || DEFAULT_TIMEOUT end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
22 23 24 |
# File 'lib/senkyoshi/configuration.rb', line 22 def account_id @account_id end |
#canvas_token ⇒ Object
Returns the value of attribute canvas_token.
21 22 23 |
# File 'lib/senkyoshi/configuration.rb', line 21 def canvas_token @canvas_token end |
#canvas_url ⇒ Object
Returns the value of attribute canvas_url.
20 21 22 |
# File 'lib/senkyoshi/configuration.rb', line 20 def canvas_url @canvas_url end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
28 29 30 |
# File 'lib/senkyoshi/configuration.rb', line 28 def request_timeout @request_timeout end |
#scorm_launch_url ⇒ Object
Returns the value of attribute scorm_launch_url.
24 25 26 |
# File 'lib/senkyoshi/configuration.rb', line 24 def scorm_launch_url @scorm_launch_url end |
#scorm_oauth_consumer_key ⇒ Object
Returns the value of attribute scorm_oauth_consumer_key.
27 28 29 |
# File 'lib/senkyoshi/configuration.rb', line 27 def scorm_oauth_consumer_key @scorm_oauth_consumer_key end |
#scorm_shared_auth ⇒ Object
Returns the value of attribute scorm_shared_auth.
26 27 28 |
# File 'lib/senkyoshi/configuration.rb', line 26 def scorm_shared_auth @scorm_shared_auth end |
#scorm_shared_id ⇒ Object
Returns the value of attribute scorm_shared_id.
25 26 27 |
# File 'lib/senkyoshi/configuration.rb', line 25 def scorm_shared_id @scorm_shared_id end |
#scorm_url ⇒ Object
Returns the value of attribute scorm_url.
23 24 25 |
# File 'lib/senkyoshi/configuration.rb', line 23 def scorm_url @scorm_url end |
Class Method Details
._config ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/senkyoshi/configuration.rb', line 46 def self._config @config ||= if File.exists? "senkyoshi.yml" YAML::safe_load(File.read("senkyoshi.yml"), [Symbol]) else {} end end |