Sha256: fffb2aae5cd2789b113706db83f0dcc4996b73f3bb6fc3f9065e2436dd38f2b6

Contents?: true

Size: 908 Bytes

Versions: 56

Compression:

Stored size: 908 Bytes

Contents

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

  Contract Symbol => Maybe[KuberKit::Core::Templates::AbstractTemplate]
  def get(template_name)
    template = get_from_configuration(template_name) || 
               get_global(template_name)

    template
  end

  Contract Symbol => Maybe[KuberKit::Core::Templates::AbstractTemplate]
  def get_global(template_name)
    store.get(template_name)
  end

  Contract Symbol => Maybe[KuberKit::Core::Templates::AbstractTemplate]
  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

56 entries across 56 versions & 1 rubygems

Version Path
kuber_kit-1.3.8 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.3.7 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.1.8 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.3.6 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.1.7 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.3.5 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.3.4 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.1.6 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.3.3 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.3.2 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.1.5 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.3.1 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.3.0 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.1.4 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.2.7 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.2.6 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.2.5 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.2.4 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.2.2 lib/kuber_kit/core/templates/template_store.rb
kuber_kit-1.1.2 lib/kuber_kit/core/templates/template_store.rb