From 62ce930e4e1342ced9e909f185836b5b91028703 Mon Sep 17 00:00:00 2001 From: Kaoru Kobo Date: Wed, 24 Nov 2010 21:07:13 +0900 Subject: [PATCH] Fixed bad usage of @group. --- lib/rhook.rb | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/rhook.rb b/lib/rhook.rb index 51374c7..23fe6b7 100644 --- a/lib/rhook.rb +++ b/lib/rhook.rb @@ -35,8 +35,10 @@ def bound_object @obj end + # ======================================================================== # @group Methods for hook-side(outside) - # + # ======================================================================== + # Add hook to the {#bound_object}. If it is a kind of Class, the hook is affected to all instance & subclasses of the class. # # @param [Symbol] name hook-point's name (commonly equals to method name) @@ -55,8 +57,6 @@ def bind(name, opt = {}, &block) hook end - # @group Methods for hook-side(outside) - # # Injects hook-point (hack) to the paticular method in {#bound_object}, and add hook same as {#bind}. # # The hook-point injection is done by 'alias' method. @@ -91,6 +91,10 @@ def unbind_all self end + # ======================================================================== + # @endgroup + # ======================================================================== + # @private class Caller def initialize(rhook, opt) @@ -103,8 +107,10 @@ def method_missing(name, *args, &block) end end #/Caller - # @group Methods for target-side (ex. providing hook-point) - # + # ======================================================================== + # @group Methods for target-side (for providing hook-point) + # ======================================================================== + # Wraps {#bound_object}'s method call to be hookable. # # @example @@ -132,8 +138,6 @@ def call_method(name, method_name, args, block, opt = {}) inv.proceed() end - # @group Methods for target-side (ex. providing hook-point) - # # Wraps the code block to be hookable. # # @example @@ -158,8 +162,6 @@ def does(name, opt = {}, &block) inv.proceed() end - # @group Methods for target-side (ex. providing hook-point) - # # Wraps the defined method to be hookable. # # If possible, using {#to} is recommended than {#on_method}, because if the subclass override the hookable method, the subclasse's code become out of hook target. @@ -196,6 +198,10 @@ def on_method(*names_and_opt) success end + # ======================================================================== + # @endgroup + # ======================================================================== + # @private def concat_hooks(dest, name) if Class === @obj