Class: IbmAppconfigurationRubySdk::Configuration

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

Overview

Holds all SDK-wide options with sensible defaults. Values are read from environment variables when present, falling back to the constants defined here.

Examples:

IbmAppconfigurationRubySdk::AppConfiguration.configure do |config|
  config.use_private_endpoint = true
  config.debug = true
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



48
49
50
51
52
# File 'lib/ibm_appconfiguration_ruby_sdk/configuration.rb', line 48

def initialize
  @use_private_endpoint = ENV.fetch("IBM_APPCONFIGURATION_PRIVATE_ENDPOINT", false)
  @debug                = ENV.fetch("IBM_APPCONFIGURATION_DEBUG", false)
  @logger               = nil
end

Instance Attribute Details

#debugBoolean

Returns Whether debug-level logging is enabled.

Returns:

  • (Boolean)

    Whether debug-level logging is enabled



35
36
37
# File 'lib/ibm_appconfiguration_ruby_sdk/configuration.rb', line 35

def debug
  @debug
end

#logger::Logger?

Returns Any ::Logger-compatible object to receive SDK log output. When nil (the default) the SDK creates a plain ::Logger writing to $stdout. Set this in the configure block to route SDK messages through your own pipeline:

@example IbmAppconfigurationRubySdk::AppConfiguration.configure do |config| config.logger = Rails.logger end.

Returns:

  • (::Logger, nil)

    Any ::Logger-compatible object to receive SDK log output. When nil (the default) the SDK creates a plain ::Logger writing to $stdout. Set this in the configure block to route SDK messages through your own pipeline:

    @example IbmAppconfigurationRubySdk::AppConfiguration.configure do |config| config.logger = Rails.logger end



46
47
48
# File 'lib/ibm_appconfiguration_ruby_sdk/configuration.rb', line 46

def logger
  @logger
end

#use_private_endpointBoolean

Returns Whether the SDK connects via IBM Cloud private endpoint.

Returns:

  • (Boolean)

    Whether the SDK connects via IBM Cloud private endpoint



31
32
33
# File 'lib/ibm_appconfiguration_ruby_sdk/configuration.rb', line 31

def use_private_endpoint
  @use_private_endpoint
end