Module: PDK::Template::Renderer

Defined in:
lib/pdk/template/renderer.rb,
lib/pdk/template/renderer/v1.rb,
lib/pdk/template/renderer/v1/renderer.rb,
lib/pdk/template/renderer/v1/template_file.rb,
lib/pdk/template/renderer/v1/legacy_template_dir.rb

Defined Under Namespace

Modules: V1 Classes: AbstractRenderer

Class Method Summary collapse

Class Method Details

.instance(template_uri, template_root, context) ⇒ AbstractRenderer?

Returns the most appropriate renderer for the given Template Directory and Context

Parameters:

  • template_root (String)

    The path to where the template exists on disk

  • template_uri (PDK::Util::TemplateUri)

    A URI which points to the source location of the Template

  • context (PDK::Context)

    The context in which the redering will occur in

Returns:

  • (AbstractRenderer, nil)

    An instance of an AbstractRenderer subclass. Returns nil if no renderer could be found



15
16
17
18
# File 'lib/pdk/template/renderer.rb', line 15

def self.instance(template_uri, template_root, context)
  return V1.instance(template_root, template_uri, context) if V1.compatible?(template_root, context)
  nil
end