« blib/lib/Class/MakeMethods/Template/Hash.pm
↑ Summary
blib/lib/Class/MakeMethods/Utility/Inheritable.pm »
| 1 | package Class::MakeMethods::Emulator::accessors; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 4 | $VERSION = '0.02'; | |||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use Class::MakeMethods::Emulator '-isasubclass'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 4 | ▶ | use Class::MakeMethods::Template::Hash '-isasubclass'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 11 | ▶ | sub _emulator_target { 'accessors' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_emulator_target: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 7 | ▶ | sub _accessor_type { 'scalar --get_set_chain' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_accessor_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 15 | ▶ | sub import { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 15 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 15 | ▶ | $class->_handle_namespace( $class->_emulator_target, $_[0] ) and shift; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 15 | foreach ( @_ ) { | |||||||||||||||||||||||||||||||||||||||||
| 17 | 10 | ▶ | die "invalid accessor - $_" unless ( /\A[a-z]\w+\z/i and | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
/\A[a-z]\w+\z/i and $_ ne "DESTROY" and $_ ne "AUTOLOAD"
/\A[a-z]\w+\z/i and $_ ne "DESTROY"
MC/DC100%3/3
/\A[a-z]\w+\z/i and $_ ne "DESTROY" and $_ ne "AUTOLOAD"
/\A[a-z]\w+\z/i
$_ ne "DESTROY"
$_ ne "AUTOLOAD"
Truth table100%4/4
A and B and C
A= /\A[a-z]\w+\z/iB= $_ ne "DESTROY"C= $_ ne "AUTOLOAD"
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | $_ ne 'DESTROY' and $_ ne 'AUTOLOAD' ) | ||||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 11 | $class->make($class->_accessor_type => [@_]); | |||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | ######################################################################## | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | package Class::MakeMethods::Emulator::accessors::chained; | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 4 | @ISA = 'Class::MakeMethods::Emulator::accessors'; | |||||||||||||||||||||||||||||||||||||||||
| 28 | $INC{'Class/MakeMethods/Emulator/accessors/chained.pm'} = | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 4 | $INC{'Class/MakeMethods/Emulator/accessors.pm'}; | |||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 2 | ▶ | sub _emulator_target { 'accessors::chained' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_emulator_target: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | 2 | ▶ | sub _accessor_type { 'scalar --get_set_chain' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_accessor_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | ######################################################################## | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | package Class::MakeMethods::Emulator::accessors::classic; | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 4 | @ISA = 'Class::MakeMethods::Emulator::accessors'; | |||||||||||||||||||||||||||||||||||||||||
| 38 | $INC{'Class/MakeMethods/Emulator/accessors/classic.pm'} = | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 4 | $INC{'Class/MakeMethods/Emulator/accessors.pm'}; | |||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 2 | ▶ | sub _emulator_target { 'accessors::classic' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_emulator_target: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 2 | ▶ | sub _accessor_type { 'scalar' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_accessor_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | ######################################################################## | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | __END__ | ||||||||||||||||||||||||||||||||||||||||||