Class: Kobana::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/kobana/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
15
16
17
# File 'lib/kobana/configuration.rb', line 11

def initialize
  @custom_headers = {}
  @environment = :sandbox
  # nil means "no global override" — each resource uses its own declared
  # api_version (see Resources::Base). Set this to force a version globally.
  @api_version = nil
end

Instance Attribute Details

#api_tokenObject

‘open_timeout` and `timeout` are passed straight to Faraday (in seconds). Both default to nil (no timeout) to preserve historical behavior; set them to fail fast instead of blocking the caller when the API is slow/hanging.



8
9
10
# File 'lib/kobana/configuration.rb', line 8

def api_token
  @api_token
end

#api_versionObject

‘open_timeout` and `timeout` are passed straight to Faraday (in seconds). Both default to nil (no timeout) to preserve historical behavior; set them to fail fast instead of blocking the caller when the API is slow/hanging.



8
9
10
# File 'lib/kobana/configuration.rb', line 8

def api_version
  @api_version
end

#custom_headersObject

‘open_timeout` and `timeout` are passed straight to Faraday (in seconds). Both default to nil (no timeout) to preserve historical behavior; set them to fail fast instead of blocking the caller when the API is slow/hanging.



8
9
10
# File 'lib/kobana/configuration.rb', line 8

def custom_headers
  @custom_headers
end

#debugObject

‘open_timeout` and `timeout` are passed straight to Faraday (in seconds). Both default to nil (no timeout) to preserve historical behavior; set them to fail fast instead of blocking the caller when the API is slow/hanging.



8
9
10
# File 'lib/kobana/configuration.rb', line 8

def debug
  @debug
end

#environmentObject

‘open_timeout` and `timeout` are passed straight to Faraday (in seconds). Both default to nil (no timeout) to preserve historical behavior; set them to fail fast instead of blocking the caller when the API is slow/hanging.



8
9
10
# File 'lib/kobana/configuration.rb', line 8

def environment
  @environment
end

#open_timeoutObject

‘open_timeout` and `timeout` are passed straight to Faraday (in seconds). Both default to nil (no timeout) to preserve historical behavior; set them to fail fast instead of blocking the caller when the API is slow/hanging.



8
9
10
# File 'lib/kobana/configuration.rb', line 8

def open_timeout
  @open_timeout
end

#timeoutObject

‘open_timeout` and `timeout` are passed straight to Faraday (in seconds). Both default to nil (no timeout) to preserve historical behavior; set them to fail fast instead of blocking the caller when the API is slow/hanging.



8
9
10
# File 'lib/kobana/configuration.rb', line 8

def timeout
  @timeout
end

Instance Method Details

#inspectObject



19
20
21
22
# File 'lib/kobana/configuration.rb', line 19

def inspect
  default_inspect = super
  default_inspect.gsub(/api_token="(.*)"/, "api_token=\"[REDACTED]\"")
end