Class: ConfigurationService::Test::OrchestrationProviderRegistry
- Inherits:
-
Object
- Object
- ConfigurationService::Test::OrchestrationProviderRegistry
- Includes:
- Singleton
- Defined in:
- lib/configuration_service/test/orchestration_provider_registry.rb
Overview
Singleton registry of Orchestrator providers
Instance Method Summary collapse
-
#initialize ⇒ OrchestrationProviderRegistry
constructor
:nodoc:.
-
#lookup(identifier) ⇒ Object
Return the
provideridentified by the stringidentifier. -
#register(identifier, provider) ⇒ Object
Register a
provideridentified by the stringidentifier.
Constructor Details
#initialize ⇒ OrchestrationProviderRegistry
:nodoc:
16 17 18 |
# File 'lib/configuration_service/test/orchestration_provider_registry.rb', line 16 def initialize ## :nodoc: @providers = {} end |
Instance Method Details
#lookup(identifier) ⇒ Object
Return the provider identified by the string identifier
The provider must already have been registered with #register, and should be a class with a default (nullary) constructor.
Returns nil if no provider has been registered with the given identifier.
38 39 40 |
# File 'lib/configuration_service/test/orchestration_provider_registry.rb', line 38 def lookup(identifier) @providers[identifier] end |
#register(identifier, provider) ⇒ Object
Register a provider identified by the string identifier
The provider should be a class with a default (nullary) constructor.
25 26 27 |
# File 'lib/configuration_service/test/orchestration_provider_registry.rb', line 25 def register(identifier, provider) @providers[identifier] = provider end |