| 1 | package SOAP::Lite::Utils; | ||||||||||
| 2 | 43 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | sub import { | ||||||||||
| 5 | 215 | ▶ | my $caller = caller(); | ||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 43 | ▶ | no strict qw(refs); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 215 | *{ "$caller\::__mk_accessors" } = \&__mk_accessors; | |||||||||
| 8 | } | ||||||||||
| 9 | |||||||||||
| 10 | sub __mk_accessors { | ||||||||||
| 11 | 215 | ▶ | my ($class, @method_from) = @_; | ||||||||
|
Subroutine
__mk_accessors: called CC=2 SCAR=6.9
| |||||||||||
| 12 | 43 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 215 | for my $method ( @method_from ) { | |||||||||
| 14 | 1505 | my $field = '_' . $method; | |||||||||
| 15 | 1505 | *{ "$class\::$method" } = sub { | |||||||||
| 16 | 3247 | ▶ | my $self = ref $_[0] ? shift : shift->new(); | ||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
| |||||||||||
| 17 | 3247 | ▶ | if (@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 659 | $self->{$field} = shift; | |||||||||
| 19 | 659 | return $self | |||||||||
| 20 | } | ||||||||||
| 21 | 2588 | return $self->{$field}; | |||||||||
| 22 | } | ||||||||||
| 23 | 1505 | } | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | |||||||||||
| 27 | 43 | 1; | |||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||