Sha256: 739d4e99b4c17b86d1e8fa622cce95de08560407d6cb12467f768b80967bf11e

Contents?: true

Size: 954 Bytes

Versions: 57

Compression:

Stored size: 954 Bytes

Contents

class KuberKit::Core::Registries::RegistryStore
  def add(registry)
    store.add(registry.name, registry)
  end

  Contract Symbol => Maybe[KuberKit::Core::Registries::AbstractRegistry]
  def get(registry_name)
    registry = get_from_configuration(registry_name) || 
               get_global(registry_name)

    registry
  end

  Contract Symbol => Maybe[KuberKit::Core::Registries::AbstractRegistry]
  def get_global(registry_name)
    store.get(registry_name)
  end

  Contract Symbol => Maybe[KuberKit::Core::Registries::AbstractRegistry]
  def get_from_configuration(registry_name)
    registries = KuberKit.current_configuration.registries
    registries[registry_name]
  end

  def default_registry
    @default_registry ||= KuberKit::Core::Registries::Registry.new(:default)
  end

  def reset!
    store.reset!
  end

  private
    def store
      @@store ||= KuberKit::Core::Store.new(KuberKit::Core::Registries::AbstractRegistry)
    end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
kuber_kit-1.1.2 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-1.2.1 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-1.2.0 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-1.1.1 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-1.0.1 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-1.0.0 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.9 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.8 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.7 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.6 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.5 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.4 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.3 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.2 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.1 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.9.0 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.8.8 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.8.7 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.8.6 lib/kuber_kit/core/registries/registry_store.rb
kuber_kit-0.8.5 lib/kuber_kit/core/registries/registry_store.rb