Exception: ConsoleAgent::SafetyError
- Inherits:
-
StandardError
- Object
- StandardError
- ConsoleAgent::SafetyError
- Defined in:
- lib/console_agent/safety_guards.rb
Overview
Raised by safety guards to block dangerous operations. Host apps should raise this error in their custom guards. ConsoleAgent will catch it and guide the user to use ‘d’ or /danger.
Instance Attribute Summary collapse
-
#blocked_key ⇒ Object
readonly
Returns the value of attribute blocked_key.
-
#guard ⇒ Object
readonly
Returns the value of attribute guard.
Instance Method Summary collapse
-
#initialize(message, guard: nil, blocked_key: nil) ⇒ SafetyError
constructor
A new instance of SafetyError.
Constructor Details
#initialize(message, guard: nil, blocked_key: nil) ⇒ SafetyError
Returns a new instance of SafetyError.
8 9 10 11 12 |
# File 'lib/console_agent/safety_guards.rb', line 8 def initialize(, guard: nil, blocked_key: nil) super() @guard = guard @blocked_key = blocked_key end |
Instance Attribute Details
#blocked_key ⇒ Object (readonly)
Returns the value of attribute blocked_key.
6 7 8 |
# File 'lib/console_agent/safety_guards.rb', line 6 def blocked_key @blocked_key end |
#guard ⇒ Object (readonly)
Returns the value of attribute guard.
6 7 8 |
# File 'lib/console_agent/safety_guards.rb', line 6 def guard @guard end |