line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cake::Utils::Accessor;
|
2
|
8
|
|
|
8
|
|
41
|
use strict;
|
|
8
|
|
|
|
|
45
|
|
|
8
|
|
|
|
|
254
|
|
3
|
8
|
|
|
8
|
|
40
|
use warnings;
|
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
241
|
|
4
|
8
|
|
|
8
|
|
40
|
use base qw/Exporter/;
|
|
8
|
|
|
|
|
19
|
|
|
8
|
|
|
|
|
1180
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @EXPORT = qw(
|
7
|
|
|
|
|
|
|
Accessor
|
8
|
|
|
|
|
|
|
);
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
###quick simple accessor
|
11
|
|
|
|
|
|
|
sub Accessor {
|
12
|
8
|
|
|
8
|
0
|
15
|
my $class;
|
13
|
8
|
50
|
|
|
|
55
|
if (caller eq $_[0]){
|
14
|
8
|
|
|
|
|
23
|
$class = shift;
|
15
|
|
|
|
|
|
|
} else {
|
16
|
0
|
|
|
|
|
0
|
$class = caller;
|
17
|
|
|
|
|
|
|
}
|
18
|
|
|
|
|
|
|
|
19
|
8
|
|
|
|
|
38
|
foreach my $method (@_){
|
20
|
48
|
|
|
|
|
97
|
my $code = $class.'::'.$method;
|
21
|
|
|
|
|
|
|
{
|
22
|
8
|
|
|
8
|
|
40
|
no strict 'refs';
|
|
8
|
|
|
|
|
11
|
|
|
8
|
|
|
|
|
1156
|
|
|
48
|
|
|
|
|
61
|
|
23
|
|
|
|
|
|
|
*$code = sub {
|
24
|
98
|
|
|
98
|
|
139
|
my $self = shift;
|
25
|
98
|
|
100
|
|
|
342
|
$self->{$method} ||= {};
|
26
|
98
|
100
|
|
|
|
268
|
if(@_ == 1) {
|
|
|
50
|
|
|
|
|
|
27
|
8
|
|
|
|
|
33
|
return $self->{$method} = $_[0];
|
28
|
|
|
|
|
|
|
} elsif (@_ > 1) {
|
29
|
0
|
|
|
|
|
0
|
return $self->{$method} = [@_];
|
30
|
|
|
|
|
|
|
} else {
|
31
|
90
|
|
|
|
|
645
|
return $self->{$method};
|
32
|
|
|
|
|
|
|
}
|
33
|
48
|
|
|
|
|
342
|
};
|
34
|
|
|
|
|
|
|
}
|
35
|
|
|
|
|
|
|
}
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1;
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__
|