Sha256: f8b0686288e76cb96903a8bbe1492a6fe65d4e46e89c00b1402d84c2bcc4a5da

Contents?: true

Size: 692 Bytes

Versions: 39

Compression:

Stored size: 692 Bytes

Contents

class KuberKit::Core::Templates::TemplateStore
  def add(template)
    store.add(template.name, template)
  end

  def get(template_name)
    template = get_from_configuration(template_name) || 
               get_global(template_name)

    template
  end

  def get_global(template_name)
    store.get(template_name)
  end

  def get_from_configuration(template_name)
    templates = KuberKit.current_configuration.templates
    templates[template_name]
  end

  def reset!
    store.reset!
  end

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

  private
    def store
      @@store ||= KuberKit::Core::Store.new(KuberKit::Core::Templates::AbstractTemplate)
    end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
kuber_kit-0.5.5 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.5.4 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.5.3 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.5.2 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.5.1 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.5.0 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.9 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.8 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.7 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.6 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.5 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.4 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.3 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.2 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.1 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.4.0 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.3.11 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.3.10 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.3.9 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-0.3.8 lib/kuber_kit/core/templates/template_store.rb