« blib/lib/Class/MakeMethods/Emulator/Singleton.pm
↑ Summary
blib/lib/Class/MakeMethods/Emulator/Struct.pm »
| 1 | package Class::MakeMethods::Emulator::Inheritable; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use Class::MakeMethods::Template::ClassInherit; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Class::MakeMethods::Emulator qw( namespace_capture namespace_release ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | my $emulation_target = 'Class::Data::Inheritable'; | |||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | sub import { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=7 SCAR=22.7
| |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | my $mm_class = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 12 | 2 | ▶ | if ( scalar @_ and $_[0] =~ /^-take_namespace/ and shift) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%4/6
scalar @_ and $_[0] =~ /^-take_namespace/ and shift()
scalar @_ and $_[0] =~ /^-take_namespace/
MC/DC33%1/3
scalar @_ and $_[0] =~ /^-take_namespace/ and shift()
scalar @_
$_[0] =~ /^-take_namespace/
shift()
Truth table50%2/4
A and B and C
A= scalar @_B= $_[0] =~ /^-take_namespace/C= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | namespace_capture(__PACKAGE__, $emulation_target); | |||||||||||||||||||||||||||||||||||||||||||||
| 14 | ▶ | } elsif ( scalar @_ and $_[0] =~ /^-release_namespace/ and shift) { | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
scalar @_ and $_[0] =~ /^-release_namespace/ and shift()
scalar @_ and $_[0] =~ /^-release_namespace/
MC/DC0%0/3
scalar @_ and $_[0] =~ /^-release_namespace/ and shift()
scalar @_
$_[0] =~ /^-release_namespace/
shift()
Truth table25%1/4
A and B and C
A= scalar @_B= $_[0] =~ /^-release_namespace/C= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | namespace_release(__PACKAGE__, $emulation_target); | |||||||||||||||||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 17 | # The fallback should really be to NEXT::import. | ||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | $mm_class->SUPER::import( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||
| 21 | ######################################################################## | ||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | ▶ | sub mk_classdata { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mk_classdata: called CC=2 SCAR=7.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 2 | my $declaredclass = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 25 | 2 | my $attribute = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 26 | 2 | Class::MakeMethods::Template::ClassInherit->make( | |||||||||||||||||||||||||||||||||||||||||||||
| 27 | -TargetClass => $declaredclass, | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 'scalar' => [ -interface => { '*'=>'get_set', '_*_accessor'=>'get_set' }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 29 | $attribute ], | ||||||||||||||||||||||||||||||||||||||||||||||
| 30 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 2 | ▶ | if ( scalar @_ ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | $declaredclass->$attribute( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||
| 36 | ######################################################################## | ||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||