| 1 | package oCLI::Plugin; | ||
| 2 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | has plugins => ( | ||
| 5 | is => 'rw', | ||
| 6 | 0 | ▶ | default => sub { return [] }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 7 | 1 | ); | |
| 8 | |||
| 9 | 0 | ▶ | sub add { |
|
Subroutine
add: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 10 | 0 | my ( $self, $plugin ) = @_; | |
| 11 | |||
| 12 | 0 | push @{$self->plugins}, $plugin; | |
| 13 | } | ||
| 14 | |||
| 15 | 0 | ▶ | sub hook_after_context { |
|
Subroutine
hook_after_context: not called CC=2 SCAR=17.9
Pod
undocumented
| |||
| 16 | 0 | my ( $self, $c ) = @_; | |
| 17 | |||
| 18 | 0 | foreach my $plugin ( @{$self->plugins} ) { | |
| 19 | 0 | $plugin->after_context($c); | |
| 20 | } | ||
| 21 | 0 | return; | |
| 22 | } | ||
| 23 | |||
| 24 | 0 | ▶ | sub hook_before_code { |
|
Subroutine
hook_before_code: not called CC=2 SCAR=17.9
Pod
undocumented
| |||
| 25 | 0 | my ( $self, $c, $command ) = @_; | |
| 26 | |||
| 27 | 0 | foreach my $plugin ( @{$self->plugins} ) { | |
| 28 | 0 | $plugin->before_code($c, $command); | |
| 29 | } | ||
| 30 | 0 | return; | |
| 31 | } | ||
| 32 | |||
| 33 | 0 | ▶ | sub hook_after_code { |
|
Subroutine
hook_after_code: not called CC=2 SCAR=17.9
Pod
undocumented
| |||
| 34 | 0 | my ( $self, $c ) = @_; | |
| 35 | |||
| 36 | 0 | foreach my $plugin ( @{$self->plugins} ) { | |
| 37 | 0 | $plugin->after_code($c); | |
| 38 | } | ||
| 39 | 0 | return; | |
| 40 | } | ||
| 41 | |||
| 42 | |||
| 43 | 1 | 1; | |