Exception: StaticMatic::AmbiguousTemplateError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/staticmatic/ambiguous_template_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template_name, ambiguous_templates) ⇒ AmbiguousTemplateError

Returns a new instance of AmbiguousTemplateError.



4
5
6
7
# File 'lib/staticmatic/ambiguous_template_error.rb', line 4

def initialize(template_name, ambiguous_templates)
  @template_name = template_name
  @ambiguous_templates = ambiguous_templates
end

Instance Attribute Details

#template_nameObject (readonly)

Returns the value of attribute template_name.



2
3
4
# File 'lib/staticmatic/ambiguous_template_error.rb', line 2

def template_name
  @template_name
end

Instance Method Details

#messageObject



9
10
11
12
13
14
15
16
17
# File 'lib/staticmatic/ambiguous_template_error.rb', line 9

def message
<<-MESSAGE
Ambiguous request when searching for a template for filename `#{@template_name}`:
There is more than one type of template available for rendering.

Templates causing the ambiguity:
#{@ambiguous_templates.join "\n"}
MESSAGE
end