Sha256: 3d3e5f4bf9d6071d488a3651f622f8abfd6fc1f4f9a7efc6426ee7300624a075

Contents?: true

Size: 908 Bytes

Versions: 56

Compression:

Stored size: 908 Bytes

Contents

class KuberKit::Core::Artifacts::ArtifactStore
  def add(artifact)
    store.add(artifact.name, artifact)
  end

  Contract Symbol => Maybe[KuberKit::Core::Artifacts::AbstractArtifact]
  def get(artifact_name)
    artifact = get_from_configuration(artifact_name) || 
               get_global(artifact_name)

    artifact
  end

  Contract Symbol => Maybe[KuberKit::Core::Artifacts::AbstractArtifact]
  def get_global(artifact_name)
    store.get(artifact_name)
  end

  Contract Symbol => Maybe[KuberKit::Core::Artifacts::AbstractArtifact]
  def get_from_configuration(artifact_name)
    artifacts = KuberKit.current_configuration.artifacts
    artifacts[artifact_name]
  end

  def reset!
    store.reset!
  end

  def exists?(artifact_name)
    store.exists?(artifact_name)
  end

  private
    def store
      @@store ||= KuberKit::Core::Store.new(KuberKit::Core::Artifacts::AbstractArtifact)
    end
end

Version data entries

56 entries across 56 versions & 1 rubygems

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