Show
Ignore:
Timestamp:
12/04/07 11:48:17 (13 months ago)
Author:
nyarla
Message:

lang/perl/Class-Hookable: I implemented registered_function method.

Location:
lang/perl/Class-Hookable/trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Class-Hookable/trunk/lib/Class/Hookable.pm

    r2390 r2391  
    219219} 
    220220 
     221sub registered_function { 
     222    my ( $self, $method ) = @_; 
     223 
     224    Carp::croak "Method name is not specified" 
     225        if ( ! $method ); 
     226 
     227    my $action = $self->hookable_all_methods->{$method}; 
     228 
     229    return if ( ! $action ); 
     230    return $action; 
     231} 
     232 
    221233sub delete_plugin { 
    222234    my ( $self, $object, @hooks ) = @_; 
     
    638650 
    639651This method returns plugin and callback registered with a hook. 
     652 
    640653Return value is a list of hash reference including plugin and callback. 
     654When there are no registered plugin and callback, this method returns empty list. 
    641655 
    642656=head2 registered_methods 
     
    650664and When specifying plugin object (or class name) as an arguments, 
    651665the method name with which a plugin is registered is returned. 
     666 
     667=head2 registered_function 
     668 
     669  my $action = $hook->registered_function('method.name'); 
     670  my ( $plugin, $function ) = @{ $action }{qw( plugin function )}; 
     671 
     672This method returns plugin and callback registered with a method. 
     673 
     674Return value is a hash reference including plugin and callback. 
     675When nothing is registered, no this methods are returned. 
    652676 
    653677=head2 delete_plugin