Exception: Treequel::BeforeHookFailed
- Inherits:
-
ModelError
- Object
- RuntimeError
- Error
- ModelError
- Treequel::BeforeHookFailed
- Defined in:
- lib/treequel/exceptions.rb
Overview
Exception class raised when a before_* hooks returns a false value when saving or destroying a Treequel::Model object.
Instance Attribute Summary collapse
-
#hook ⇒ Object
readonly
The hook that failed.
Instance Method Summary collapse
-
#initialize(hook) ⇒ BeforeHookFailed
constructor
Create a new Treequel::BeforeHookFailed exception that indicates that the specified
hookreturned a false value.
Constructor Details
#initialize(hook) ⇒ BeforeHookFailed
Create a new Treequel::BeforeHookFailed exception that indicates that the specified hook returned a false value.
58 59 60 61 |
# File 'lib/treequel/exceptions.rb', line 58 def initialize( hook ) @hook = hook.to_sym super "The 'before' hook failed when trying to %s" % [ hook ] end |
Instance Attribute Details
#hook ⇒ Object (readonly)
The hook that failed
68 69 70 |
# File 'lib/treequel/exceptions.rb', line 68 def hook @hook end |