| 1 | package Data::Model::Accessor; | ||||||||||
| 2 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 5 | ▶ | sub mk_accessors { | ||||||||
|
Subroutine
mk_accessors: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 6 | 5 | my $class = shift; | |||||||||
| 7 | 5 | for my $field (@_) { | |||||||||
| 8 | 4 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 58 | ▶ | *{"$class\::$field"} = sub { | ||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||
| 10 | 1165 | ▶ | return $_[0]->{$field} unless @_ > 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | 261 | my $self = shift; | |||||||||
| 12 | 261 | ▶ | $self->{$field} = (@_ == 1 ? $_[0] : [@_]); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 58 | }; | |||||||||
| 14 | } | ||||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 4 | 1; | |||||||||