Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Fixed bad usage of @group.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaoru Kobo committed Nov 24, 2010
1 parent 243625b commit 62ce930
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions lib/rhook.rb
Expand Up @@ -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)
Expand All @@ -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.
Expand Down Expand Up @@ -91,6 +91,10 @@ def unbind_all
self
end

# ========================================================================
# @endgroup
# ========================================================================

# @private
class Caller
def initialize(rhook, opt)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -196,6 +198,10 @@ def on_method(*names_and_opt)
success
end

# ========================================================================
# @endgroup
# ========================================================================

# @private
def concat_hooks(dest, name)
if Class === @obj
Expand Down

0 comments on commit 62ce930

Please sign in to comment.