Module: Fluence::Gateway::Configuration

Included in:
Fluence::Gateway
Defined in:
lib/fluence/gateway/configuration.rb

Overview

Provides SDK configuration management.

Extended by Fluence::Gateway so that #config and #configure are available directly on the module (no instance to pass around). The underlying storage is a Settings singleton.

Only client_id and client_secret have no defaults and must be set before any gateway call; URL and timeout defaults target Fluence's production environment and can be overridden per deployment.

Examples:

Configure the SDK (typically in a Rails initializer)

Fluence::Gateway.configure do |config|
  config.client_id     = ENV.fetch('GATEWAY_CLIENT_ID')
  config.client_secret = ENV.fetch('GATEWAY_CLIENT_SECRET')
  config.gateway_url   = 'https://gateway.staging.fluence-europe.cloud'
end

Read a setting at runtime

Fluence::Gateway.config.timeout # => 30

Defined Under Namespace

Classes: Settings

Instance Method Summary collapse

Instance Method Details

#configSettings

Returns the singleton configuration instance.

Returns:

  • (Settings)

    the configuration instance

#configure {|config| ... } ⇒ void

This method returns an undefined value.

Configures the SDK via a block.

Yield Parameters:

  • config (Settings)

    the configuration instance to modify