Class: Ymlbill::TemplateResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/ymlbill/template_resolver.rb

Constant Summary collapse

DEFAULT_TEMPLATE_PATH =
File.expand_path('templates/default.html.erb', __dir__)

Class Method Summary collapse

Class Method Details

.resolve(template_path) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/ymlbill/template_resolver.rb', line 6

def resolve(template_path)
  return DEFAULT_TEMPLATE_PATH if template_path.nil?

  unless File.exist?(template_path)
    raise TemplateNotFoundError, "Template not found: #{template_path}"
  end

  template_path
end