| 1 | package EO::Method; | ||||||||||
| 2 | |||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 5 | ▶ | use EO; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 5 | our @ISA = qw( EO ); | |||||||||
| 8 | 5 | our $VERSION = 0.96; | |||||||||
| 9 | |||||||||||
| 10 | 0 | ▶ | sub new_with_reference { | ||||||||
|
Subroutine
new_with_reference: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 11 | 0 | my $class = shift; | |||||||||
| 12 | 0 | my $name = shift; | |||||||||
| 13 | 0 | my $ref = shift; | |||||||||
| 14 | 0 | my $self = $class->new( @_ ); | |||||||||
| 15 | 0 | $self->name( $name ); | |||||||||
| 16 | 0 | $self->reference( $ref ); | |||||||||
| 17 | 0 | return $self; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 101 | ▶ | sub name { | ||||||||
|
Subroutine
name: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 21 | 101 | my $self = shift; | |||||||||
| 22 | 101 | ▶ | if (@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 69 | $self->{ methodname } = shift; | |||||||||
| 24 | 69 | return $self; | |||||||||
| 25 | } | ||||||||||
| 26 | 32 | return $self->{ methodname }; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 101 | ▶ | sub reference { | ||||||||
|
Subroutine
reference: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 30 | 101 | my $self = shift; | |||||||||
| 31 | 101 | ▶ | if (@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 69 | $self->{ methodreference } = shift; | |||||||||
| 33 | 69 | return $self; | |||||||||
| 34 | } | ||||||||||
| 35 | 32 | return $self->{ methodreference }; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 0 | ▶ | sub code { | ||||||||
|
Subroutine
code: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 39 | 0 | my $self = shift; | |||||||||
| 40 | 0 | my $class = EO::Class->new_with_classname( 'B::Deparse' ); | |||||||||
| 41 | 0 | eval { | |||||||||
| 42 | 0 | $class->load; | |||||||||
| 43 | }; | ||||||||||
| 44 | 0 | ▶ | if (!$@) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | 0 | my $b = B::Deparse->new(); | |||||||||
| 46 | 0 | return $b->coderef2text( $self->reference ); | |||||||||
| 47 | } | ||||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 0 | ▶ | sub call { | ||||||||
|
Subroutine
call: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 51 | 0 | my $self = shift; | |||||||||
| 52 | 0 | $self->reference->( @_ ); | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | 5 | 1; | |||||||||
| 56 | |||||||||||
| 57 | __END__ | ||||||||||