Module: Mu::Action::HookPropagator

Defined in:
lib/mu/action.rb

Overview

Internal module that ensures hook arrays are properly duplicated when action classes are inherited, preventing shared state between classes.

Instance Method Summary collapse

Instance Method Details

#inherited(subclass) ⇒ Object



45
46
47
48
49
50
# File 'lib/mu/action.rb', line 45

def inherited(subclass)
  super
  subclass.instance_variable_set(:@before_hooks, before_hooks.dup)
  subclass.instance_variable_set(:@after_hooks, after_hooks.dup)
  subclass.instance_variable_set(:@around_hooks, around_hooks.dup)
end