Exception: Treequel::BeforeHookFailed

Inherits:
ModelError show all
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

Instance Method Summary collapse

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

#hookObject (readonly)

The hook that failed



68
69
70
# File 'lib/treequel/exceptions.rb', line 68

def hook
  @hook
end