line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::MixinFactory; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = 0.92; |
4
|
|
|
|
|
|
|
|
5
|
8
|
|
|
8
|
|
67346
|
use strict; |
|
8
|
|
|
|
|
20
|
|
|
8
|
|
|
|
|
328
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
######################################################################## |
8
|
|
|
|
|
|
|
|
9
|
8
|
|
|
8
|
|
6512
|
use Class::MixinFactory::Factory; |
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
353
|
|
10
|
5
|
|
|
5
|
0
|
4265
|
sub base_factory_class { 'Class::MixinFactory::Factory' } |
11
|
|
|
|
|
|
|
|
12
|
8
|
|
|
8
|
|
7890
|
use Class::MixinFactory::HasAFactory; |
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
975
|
|
13
|
2
|
|
|
2
|
0
|
4298
|
sub hasa_factory_class { 'Class::MixinFactory::HasAFactory' } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
######################################################################## |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { |
18
|
12
|
|
|
12
|
|
689
|
my ( $facade, $import, @args ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
12
|
100
|
|
|
|
8364
|
return unless $import; |
21
|
8
|
|
|
|
|
27
|
my $target_class = ( caller )[0]; |
22
|
|
|
|
|
|
|
|
23
|
8
|
|
|
8
|
|
45
|
no strict 'refs'; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
1547
|
|
24
|
|
|
|
|
|
|
|
25
|
8
|
100
|
|
|
|
37
|
if ( $import eq '-isafactory' ) { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
26
|
3
|
|
|
|
|
7
|
push @{"$target_class\::ISA"}, $facade->base_factory_class; |
|
3
|
|
|
|
|
27
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
} elsif ( $import eq '-hasafactory' ) { |
29
|
2
|
|
|
|
|
4
|
push @{"$target_class\::ISA"}, $facade->hasa_factory_class(); |
|
2
|
|
|
|
|
15
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
} elsif ( $import eq '-isasubclass' ) { |
32
|
3
|
|
|
|
|
4
|
push @{"$target_class\::ISA"}, (shift @args)->class( @args ); |
|
3
|
|
|
|
|
24
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} else { |
35
|
0
|
|
|
|
|
0
|
require Exporter; |
36
|
0
|
|
|
|
|
0
|
goto &Exporter::import |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
######################################################################## |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub new { |
43
|
2
|
|
|
2
|
0
|
33
|
(shift)->base_factory_class->new( @_ ) |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
######################################################################## |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |