| 1 | package Class::MOP::Method::Generated; | ||||||||||||||||||||||||||||
| 2 | 459 | our $VERSION = '2.4001'; | |||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 459 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 459 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 459 | ▶ | use Eval::Closure; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 459 | ▶ | use parent 'Class::MOP::Method'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | ## accessors | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | 1 | $_[0]->_throw_exception( CannotCallAnAbstractBaseMethod => package_name => __PACKAGE__ ); | |||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 1 | ▶ | sub _initialize_body { | ||||||||||||||||||||||||||
|
Subroutine
_initialize_body: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | 1 | $_[0]->_throw_exception( NoBodyToInitializeInAnAbstractBaseClass => package_name => __PACKAGE__ ); | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 54598 | ▶ | sub _generate_description { | ||||||||||||||||||||||||||
|
Subroutine
_generate_description: called CC=8 SCAR=21.3
| |||||||||||||||||||||||||||||
| 22 | 54598 | my ( $self, $context ) = @_; | |||||||||||||||||||||||||||
| 23 | 54598 | ▶ | $context ||= $self->definition_context; | ||||||||||||||||||||||||||
|
Condition66%2/3
$context ||= $self->definition_context
MC/DC50%1/2
$context ||= $self->definition_context
$context
$self->definition_context
Truth table66%2/3
A ||= B
A= $contextB= $self->definition_context
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 54598 | my $desc = "generated method"; | |||||||||||||||||||||||||||
| 26 | 54598 | my $origin = "unknown origin"; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 54598 | ▶ | if (defined $context) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 54547 | ▶ | if (defined $context->{description}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | 54547 | $desc = $context->{description}; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 54547 | ▶ | if (defined $context->{file} || defined $context->{line}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $context->{"file"} or defined $context->{"line"}
MC/DC50%1/2
defined $context->{"file"} or defined $context->{"line"}
defined $context->{"file"}
defined $context->{"line"}
Truth table66%2/3
A or B
A= defined $context->{"file"}B= defined $context->{"line"}
| |||||||||||||||||||||||||||||
| 34 | $origin = "defined at " | ||||||||||||||||||||||||||||
| 35 | . (defined $context->{file} | ||||||||||||||||||||||||||||
| 36 | ? $context->{file} : "<unknown file>") | ||||||||||||||||||||||||||||
| 37 | . " line " | ||||||||||||||||||||||||||||
| 38 | . (defined $context->{line} | ||||||||||||||||||||||||||||
| 39 | 53664 | ▶ | ? $context->{line} : "<unknown line>"); | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 54598 | return "$desc ($origin)"; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 54599 | ▶ | sub _compile_code { | ||||||||||||||||||||||||||
|
Subroutine
_compile_code: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 47 | 54599 | my ( $self, @args ) = @_; | |||||||||||||||||||||||||||
| 48 | 54599 | ▶ | unshift @args, 'source' if @args % 2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | 54599 | my %args = @args; | |||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 54599 | my $context = delete $args{context}; | |||||||||||||||||||||||||||
| 52 | 54599 | ▶ | my $environment = $self->can('_eval_environment') | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 53 | ? $self->_eval_environment | ||||||||||||||||||||||||||||
| 54 | : {}; | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 54598 | return eval_closure( | |||||||||||||||||||||||||||
| 57 | environment => $environment, | ||||||||||||||||||||||||||||
| 58 | description => $self->_generate_description($context), | ||||||||||||||||||||||||||||
| 59 | %args, | ||||||||||||||||||||||||||||
| 60 | ); | ||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 459 | 1; | |||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | # ABSTRACT: Abstract base class for generated methods | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | __END__ | ||||||||||||||||||||||||||||