| 1 | package Test2::EventFacet::Meta; | ||||||||||
| 2 | 455 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 455 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 455 | our $VERSION = '1.302226'; | |||||||||
| 6 | |||||||||||
| 7 | 455 | ▶ | BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | # replace set_details | ||||||||||
| 10 | { | ||||||||||
| 11 | 455 | ▶ | no warnings 'redefine'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | ▶ | sub set_details { $_[0]->{'set_details'} } | ||||||||
|
Subroutine
set_details: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | 455 | ▶ | sub can { | ||||||||
|
Subroutine
can: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 16 | 9 | my $self = shift; | |||||||||
| 17 | 9 | my ($name) = @_; | |||||||||
| 18 | |||||||||||
| 19 | 9 | my $existing = $self->SUPER::can($name); | |||||||||
| 20 | 9 | ▶ | return $existing if $existing; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | |||||||||||
| 22 | # Only vivify when called on an instance, do not vivify for a class. There | ||||||||||
| 23 | # are a lot of magic class methods used in things like serialization (or | ||||||||||
| 24 | # the forks.pm module) which cause problems when vivified. | ||||||||||
| 25 | 8 | ▶ | return undef unless ref($self); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | 8 | ▶ | my $sub = sub { $_[0]->{$name} }; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 28 | { | ||||||||||
| 29 | 455 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 30 | 8 | *$name = $sub; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 8 | return $sub; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 6 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: called CC=1 SCAR=0.0
| |||||||||||
| 37 | 6 | my $name = our $AUTOLOAD; | |||||||||
| 38 | 6 | $name =~ s/^.*:://g; | |||||||||
| 39 | 6 | my $sub = $_[0]->can($name); | |||||||||
| 40 | 6 | goto &$sub; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 455 | 1; | |||||||||
| 44 | |||||||||||
| 45 | __END__ | ||||||||||