Class: OpenSandbox::Configuration
- Inherits:
-
Object
- Object
- OpenSandbox::Configuration
- Defined in:
- lib/open_sandbox/client.rb
Overview
Global configuration object
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
42 43 44 45 46 47 |
# File 'lib/open_sandbox/client.rb', line 42 def initialize @base_url = ENV.fetch("SANDBOX_DOMAIN", "http://localhost:8787") @api_key = ENV.fetch("SANDBOX_API_KEY", nil) @timeout = ENV.fetch("SANDBOX_TIMEOUT", 300).to_i @logger = Logger.new(nil) # silent by default end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
40 41 42 |
# File 'lib/open_sandbox/client.rb', line 40 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
40 41 42 |
# File 'lib/open_sandbox/client.rb', line 40 def base_url @base_url end |
#logger ⇒ Object
Returns the value of attribute logger.
40 41 42 |
# File 'lib/open_sandbox/client.rb', line 40 def logger @logger end |
#timeout ⇒ Object
Returns the value of attribute timeout.
40 41 42 |
# File 'lib/open_sandbox/client.rb', line 40 def timeout @timeout end |