Sha256: 196209b8fcfd2b82ae2cf8c0666bd20a4a579897af7a3a5e53d4ca560aa5d670

Contents?: true

Size: 707 Bytes

Versions: 7

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

require 'dry/system/provider'
require 'dry/system/provider_registry'

module Dry
  module System
    # Register external component provider
    #
    # @api public
    def self.register_provider(identifier, options)
      providers.register(identifier, options)
      providers[identifier].load_components
      self
    end

    # Register an external component that can be booted within other systems
    #
    # @api public
    def self.register_component(identifier, provider:, &block)
      providers[provider].register_component(identifier, block)
      self
    end

    # @api private
    def self.providers
      @providers ||= ProviderRegistry.new
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dry-system-0.17.0 lib/dry/system.rb
dry-system-0.15.0 lib/dry/system.rb
dry-system-0.14.1 lib/dry/system.rb
dry-system-0.14.0 lib/dry/system.rb
dry-system-0.13.2 lib/dry/system.rb
dry-system-0.13.1 lib/dry/system.rb
dry-system-0.13.0 lib/dry/system.rb