Sha256: 4ab6b0f06a30b8afc3088a2b912d2ba7ee0242c251f995f6733359b150b4de66

Contents?: true

Size: 469 Bytes

Versions: 14

Compression:

Stored size: 469 Bytes

Contents

# frozen_string_literal: true

module Dry
  module System
    class ProviderRegistry
      include Enumerable

      attr_reader :items

      def initialize
        @items = []
      end

      def each(&block)
        items.each(&block)
      end

      def register(identifier, options)
        items << Provider.new(identifier, options)
      end

      def [](identifier)
        detect { |provider| provider.identifier == identifier }
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dry-system-0.20.0 lib/dry/system/provider_registry.rb
dry-system-0.19.2 lib/dry/system/provider_registry.rb
dry-system-0.18.2 lib/dry/system/provider_registry.rb
dry-system-0.19.1 lib/dry/system/provider_registry.rb
dry-system-0.19.0 lib/dry/system/provider_registry.rb
dry-system-0.18.1 lib/dry/system/provider_registry.rb
dry-system-0.18.0 lib/dry/system/provider_registry.rb
dry-system-0.17.0 lib/dry/system/provider_registry.rb
dry-system-0.15.0 lib/dry/system/provider_registry.rb
dry-system-0.14.1 lib/dry/system/provider_registry.rb
dry-system-0.14.0 lib/dry/system/provider_registry.rb
dry-system-0.13.2 lib/dry/system/provider_registry.rb
dry-system-0.13.1 lib/dry/system/provider_registry.rb
dry-system-0.13.0 lib/dry/system/provider_registry.rb