Exception: Pragma::Macro::MissingSkillError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pragma/macro.rb

Overview

Error raised when a skill is required but not present.

Instance Method Summary collapse

Constructor Details

#initialize(macro, skill) ⇒ MissingSkillError

Initializes the error.

Parameters:

  • macro (String)

    the macro requiring the skill

  • skill (String)

    the name of the missing skill



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/pragma/macro.rb', line 30

def initialize(macro, skill)
  message = <<~ERROR
    You are attempting to use the #{macro} macro, but no `#{skill}' skill is defined.

    You can define the skill by adding the following to your operation:

      self['#{skill}'] = MyCustomClass

    If the skill holds a class, this can happen when the required class (e.g. the contract
    class) is not in the expected location. If that's the case, you can just move the class to
    the expected location and avoid defining the skill manually.
  ERROR

  super message
end