Class: SpecForge::Error::InvalidInvocationError
- Inherits:
-
Error
- Object
- Error
- SpecForge::Error::InvalidInvocationError
- Defined in:
- lib/spec_forge/error.rb
Overview
Raised when a step in an invocation chain is invalid Provides detailed information about where in the chain the error occurred
Instance Method Summary collapse
-
#initialize(step, object, resolution_path = {}) ⇒ InvalidInvocationError
constructor
A new instance of InvalidInvocationError.
-
#with_resolution_path(path) ⇒ Object
Creates a new InvalidInvocationError with a new resolution path.
Constructor Details
#initialize(step, object, resolution_path = {}) ⇒ InvalidInvocationError
Returns a new instance of InvalidInvocationError.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/spec_forge/error.rb', line 105 def initialize(step, object, resolution_path = {}) @step = step @object = object @resolution_path = resolution_path object_class = case object when Data object.class.name || "Data" when Struct object.class.name || "Struct" else object.class end super(<<~STRING.chomp Cannot invoke "#{step}" on #{object_class} #{} STRING ) end |
Instance Method Details
#with_resolution_path(path) ⇒ Object
Creates a new InvalidInvocationError with a new resolution path
132 133 134 |
# File 'lib/spec_forge/error.rb', line 132 def with_resolution_path(path) self.class.new(@step, @object, path) end |