# File lib/extlib/hook.rb, line 172
      def register_hook(target_method, scope)
        if scope == :instance && !method_defined?(target_method)
          raise ArgumentError, "#{target_method} instance method does not exist"
        elsif scope == :class && !respond_to?(target_method)
          raise ArgumentError, "#{target_method} class method does not exist"
        end

        hooks = hooks_with_scope(scope)

        if hooks[target_method].nil?
          hooks[target_method] = {
            # We need to keep track of which class in the Inheritance chain the
            # method was declared hookable in. Every time a child declares a new
            # hook for the method, the hook stack invocations need to be redefined
            # in the original Class. See #define_hook_stack_execution_methods
            :before => [], :after => [], :in => self
          }

          define_hook_stack_execution_methods(target_method, scope)
          define_advised_method(target_method, scope)
        end
      end