Exception: Shifty::PolicyViolation
- Inherits:
-
PolicyError
- Object
- StandardError
- Error
- PolicyError
- Shifty::PolicyViolation
- Defined in:
- lib/shifty/errors.rb
Overview
Raised when a task mutates a value it received under a policy that forbids mutation. Wraps the original FrozenError (never masks it) and names the worker, the effective policy, and the object the task tried to mutate, with a heuristic locating that object relative to the handed-off value.
Instance Attribute Summary collapse
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
Attributes inherited from PolicyError
Instance Method Summary collapse
-
#initialize(worker:, policy:, receiver:, value:, cause:) ⇒ PolicyViolation
constructor
A new instance of PolicyViolation.
Methods inherited from PolicyError
Constructor Details
#initialize(worker:, policy:, receiver:, value:, cause:) ⇒ PolicyViolation
Returns a new instance of PolicyViolation.
32 33 34 35 36 37 38 39 |
# File 'lib/shifty/errors.rb', line 32 def initialize(worker:, policy:, receiver:, value:, cause:) @worker = worker @policy = policy @receiver = receiver @value = value @wrapped_cause = cause super() end |
Instance Attribute Details
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
30 31 32 |
# File 'lib/shifty/errors.rb', line 30 def receiver @receiver end |