Changeset 2278 for lang/perl/Class-Hookable
- Timestamp:
- 12/02/07 10:51:42 (13 months ago)
- Location:
- lang/perl/Class-Hookable/trunk
- Files:
-
- 2 modified
- 1 moved
-
lib/Class/Hookable.pm (modified) (4 diffs)
-
t/03_utility/01_registered_callbacks.t (moved) (moved from lang/perl/Class-Hookable/trunk/t/03_utility/01_registered_plugins) (1 diff)
-
t/03_utility/03_delete_hook.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Class-Hookable/trunk/lib/Class/Hookable.pm
r2120 r2278 148 148 } 149 149 150 sub registered_ plugins {150 sub registered_callbacks { 151 151 my ( $self, $hook ) = @_; 152 152 … … 173 173 174 174 my @actions = (); 175 for my $action ( $self->registered_ plugins( $hook ) ) {175 for my $action ( $self->registered_callbacks( $hook ) ) { 176 176 my $plugin = $action->{'plugin'}; 177 177 my $class = ref $plugin || $plugin; … … 216 216 my $context = ( defined $self->hookable_context ) ? $self->hookable_context : $self ; 217 217 218 for my $action ( $self->registered_ plugins( $hook ) ) {218 for my $action ( $self->registered_callbacks( $hook ) ) { 219 219 if ( $self->hookable_call_filter( 'run_hook', $hook, $args, $action ) ) { 220 220 my $plugin = $action->{'plugin'}; … … 530 530 the hook name with which a plugin is registered is returned. 531 531 532 =head2 registered_ plugins533 534 for my $action ( $hook->registered_ plugins('hook.name') ) {532 =head2 registered_callbacks 533 534 for my $action ( $hook->registered_callbacks('hook.name') ) { 535 535 my ( $plugin, $callback ) = @{ $action }{qw( plugin callback )}; 536 536 # some code -
lang/perl/Class-Hookable/trunk/t/03_utility/01_registered_callbacks.t
r1876 r2278 24 24 25 25 is_deeply( 26 [ $hook->registered_ plugins('aaa.bbb') ],26 [ $hook->registered_callbacks('aaa.bbb') ], 27 27 [ 28 28 { plugin => $pluginA, callback => $pluginA->can('foo') }, -
lang/perl/Class-Hookable/trunk/t/03_utility/03_delete_hook.t
r1876 r2278 33 33 34 34 is_deeply( 35 [ $hook->registered_ plugins('hook.B') ],35 [ $hook->registered_callbacks('hook.B') ], 36 36 [], 37 37 );
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)