Exception: Pandocomatic::TemplateError

Inherits:
PandocomaticError show all
Defined in:
lib/pandocomatic/error/template_error.rb

Overview

A TemplateError

Instance Attribute Summary

Attributes inherited from PandocomaticError

#data, #error, #type

Instance Method Summary collapse

Methods inherited from PandocomaticError

#data?, #error?, #print, #show

Constructor Details

#initialize(type = :unknown, data = nil) ⇒ TemplateError

Create a new PandocomaticError

Parameters:

  • type (Symbol = :unknown) (defaults to: :unknown)

    the type of error, defaults to :unknown

  • data (Object = nil) (defaults to: nil)

    extra information attached to this TemplateError, if any; optional



31
32
33
# File 'lib/pandocomatic/error/template_error.rb', line 31

def initialize(type = :unknown, data = nil)
  super(type, nil, data)
end

Instance Method Details

#templateObject

The template to print this TemplateError



44
45
46
# File 'lib/pandocomatic/error/template_error.rb', line 44

def template
  'template_error.txt'
end

#to_sString

Represent this template error as a string.

Returns:

  • (String)


37
38
39
40
41
# File 'lib/pandocomatic/error/template_error.rb', line 37

def to_s
  "Environment variable '#{@data[:key]}'" \
    "#{" in '#{@data[:path]}'" unless @data[:path].nil?} " \
    'does not exist: No substitution possible.'
end