Class: ActiveSupport::ExecutionWrapper::RunHook

Inherits:
Struct 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



22
23
24
# File 'lib/active_support/execution_wrapper.rb', line 22

def hook
  @hook
end

Instance Method Details

#before(target) ⇒ Object



23
24
25
26
# File 'lib/active_support/execution_wrapper.rb', line 23

def before(target)
  hook_state = target.send(:hook_state)
  hook_state[hook] = hook.run
end