| 1 | package Class::Accessor::Fast; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 4 | ▶ | use base 'Class::Accessor'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use B 'perlstring'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | $Class::Accessor::Fast::VERSION = '0.51'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | ▶ | sub make_accessor { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
make_accessor: called CC=1 SCAR=0.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 6 | my ($class, $field) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | eval sprintf q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | return $_[0]{%s} if scalar(@_) == 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | return $_[0]{%s} = scalar(@_) == 2 ? $_[1] : [@_[1..$#_]]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | }, map { perlstring($_) } $field, $field; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=13.8
Subroutine
__ANON__: called CC=3 SCAR=13.8
Subroutine
__ANON__: not called CC=3 SCAR=13.8
Subroutine
__ANON__: called CC=3 SCAR=13.8
Subroutine
__ANON__: not called CC=3 SCAR=13.8
Subroutine
__ANON__: called CC=3 SCAR=13.8
Branch: 12 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 7 | ▶ | sub make_ro_accessor { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
make_ro_accessor: called CC=1 SCAR=0.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 7 | my($class, $field) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | eval sprintf q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | return $_[0]{%s} if @_ == 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | my $caller = caller; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | $_[0]->_croak(sprintf "'$caller' cannot alter the value of '%%s' on objects of class '%%s'", %s, %s); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | }, map { perlstring($_) } $field, $field, $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=8.3
Subroutine
__ANON__: not called CC=2 SCAR=8.3
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 7 | ▶ | sub make_wo_accessor { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
make_wo_accessor: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 7 | my($class, $field) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | eval sprintf q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | if (@_ == 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | my $caller = caller; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | $_[0]->_croak(sprintf "'$caller' cannot access the value of '%%s' on objects of class '%%s'", %s, %s); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | return $_[0]{%s} = $_[1] if @_ == 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | return (shift)->{%s} = \@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | }, map { perlstring($_) } $field, $class, $field, $field; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
Subroutine
__ANON__: called CC=3 SCAR=11.0
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||