Method: PDK::TemplateFile#render

Defined in:
lib/pdk/template_file.rb

#renderString

Renders the template by calling the appropriate engine based on the file extension.

If the template has an ‘.erb` extension, the content of the template file will be treated as an ERB template. All other extensions are treated as plain text.

Returns:

  • (String)

    The rendered template

Raises:

  • (ArgumentError)

    If the template file does not exist or can not be



38
39
40
41
42
43
44
45
# File 'lib/pdk/template_file.rb', line 38

def render
  case File.extname(@template_file)
  when '.erb'
    render_erb
  else
    render_plain
  end
end