Class: ActiveSupport::ExecutionWrapper::CompleteHook

Inherits:
Struct
  • Object
show all
Defined in:
lib/active_support/execution_wrapper.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

#as_json

Instance Attribute Details

#hookObject

Returns the value of attribute hook

Returns:

  • (Object)

    the current value of hook



33
34
35
# File 'lib/active_support/execution_wrapper.rb', line 33

def hook
  @hook
end

Instance Method Details

#before(target) ⇒ Object Also known as: after



34
35
36
37
38
39
# File 'lib/active_support/execution_wrapper.rb', line 34

def before(target)
  hook_state = target.send(:hook_state)
  if hook_state.key?(hook)
    hook.complete hook_state[hook]
  end
end