Class: Cuprum::Cli::Errors::Files::TemplateNotResolved

Inherits:
TemplateError
  • Object
show all
Defined in:
lib/cuprum/cli/errors/files/template_not_resolved.rb

Overview

Error returned when unable to resolve a template for a templated file.

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.cli.errors.files.template_not_resolved'

Instance Attribute Summary collapse

Attributes inherited from TemplateError

#details, #template_name

Instance Method Summary collapse

Constructor Details

#initialize(file_path:, details: nil, message: nil, options: {}) ⇒ TemplateNotResolved

Returns a new instance of TemplateNotResolved.

Parameters:

  • file_path (String)

    the file path for the templated file.

  • details (String) (defaults to: nil)

    additional information about the error.

  • message (String) (defaults to: nil)

    an optional message to display.

  • options (Hash) (defaults to: {})

    options used when attempting to resolve the template.



17
18
19
20
21
22
# File 'lib/cuprum/cli/errors/files/template_not_resolved.rb', line 17

def initialize(file_path:, details: nil, message: nil, options: {})
  @file_path = file_path
  @options   = options

  super(details:, file_path:, message: default_message(message), options:)
end

Instance Attribute Details

#file_pathString (readonly)

Returns the file path for the templated file.

Returns:

  • (String)

    the file path for the templated file.



25
26
27
# File 'lib/cuprum/cli/errors/files/template_not_resolved.rb', line 25

def file_path
  @file_path
end

#optionsHash (readonly)

Returns options used when attempting to resolve the template.

Returns:

  • (Hash)

    options used when attempting to resolve the template.



28
29
30
# File 'lib/cuprum/cli/errors/files/template_not_resolved.rb', line 28

def options
  @options
end