Class: IbmAppconfigurationRubySdk::Configuration
- Inherits:
-
Object
- Object
- IbmAppconfigurationRubySdk::Configuration
- 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.
Instance Attribute Summary collapse
-
#debug ⇒ Boolean
Whether debug-level logging is enabled.
-
#logger ⇒ ::Logger?
Any ::Logger-compatible object to receive SDK log output.
-
#use_private_endpoint ⇒ Boolean
Whether the SDK connects via IBM Cloud private endpoint.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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
#debug ⇒ Boolean
Returns 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.
46 47 48 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configuration.rb', line 46 def logger @logger end |
#use_private_endpoint ⇒ Boolean
Returns 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 |