Class: OpenSandbox::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/open_sandbox/client.rb

Overview

Global configuration object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_keyObject

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_urlObject

Returns the value of attribute base_url.



40
41
42
# File 'lib/open_sandbox/client.rb', line 40

def base_url
  @base_url
end

#loggerObject

Returns the value of attribute logger.



40
41
42
# File 'lib/open_sandbox/client.rb', line 40

def logger
  @logger
end

#timeoutObject

Returns the value of attribute timeout.



40
41
42
# File 'lib/open_sandbox/client.rb', line 40

def timeout
  @timeout
end