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