define_hook_stack_execution_methods (Extlib::Hook::ClassMethods)

    # File lib/extlib/hook.rb, line 225
          def define_hook_stack_execution_methods(target_method, scope)
            unless registered_as_hook?(target_method, scope)
              raise ArgumentError, "#{target_method} has not be registered as a hookable #{scope} method"
            end

            hooks = hooks_with_scope(scope)

            before_hooks = hooks[target_method][:before]
            before_hooks = before_hooks.map{ |info| inline_call(info, scope) }.join("\n")

            after_hooks  = hooks[target_method][:after]
            after_hooks  = after_hooks.map{ |info| inline_call(info, scope) }.join("\n")

            before_hook_name = hook_method_name(target_method, 'execute_before', 'hook_stack')
            after_hook_name  = hook_method_name(target_method, 'execute_after',  'hook_stack')

            hooks[target_method][:in].class_eval "\#{scope == :class ? 'class << self' : ''}\n\nprivate\n\nremove_method :\#{before_hook_name} if instance_methods(false).any? { |m| m.to_sym == :\#{before_hook_name} }\ndef \#{before_hook_name}(*args)\n\#{before_hooks}\nend\n\nremove_method :\#{after_hook_name} if instance_methods(false).any? { |m| m.to_sym == :\#{after_hook_name} }\ndef \#{after_hook_name}(*args)\n\#{after_hooks}\nend\n\n\#{scope == :class ? 'end' : ''}\n", __FILE__, __LINE__ + 1
          end