line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::revealup::base; |
2
|
5
|
|
|
5
|
|
29425
|
use strict; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
142
|
|
3
|
5
|
|
|
5
|
|
25
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
248
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub import { |
6
|
16
|
|
|
16
|
|
53
|
my $caller = caller(0); |
7
|
5
|
|
|
5
|
|
29
|
no strict 'refs'; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
1224
|
|
8
|
16
|
|
|
47
|
|
130
|
*{"${caller}::has"} = sub { attr($caller, @_) }; |
|
16
|
|
|
|
|
93
|
|
|
47
|
|
|
|
|
135
|
|
9
|
16
|
|
|
|
|
69
|
*{"${caller}::new"} = sub { |
10
|
12
|
|
|
12
|
|
4705
|
my ($klass, %opt) = @_; |
11
|
12
|
|
|
|
|
40
|
for my $key (keys %opt) { |
12
|
8
|
100
|
|
|
|
36
|
attr($caller, $key, $opt{$key}) if $opt{$key}; |
13
|
|
|
|
|
|
|
} |
14
|
12
|
|
|
|
|
44
|
return bless \%opt, $klass; |
15
|
16
|
|
|
|
|
64
|
}; |
16
|
16
|
|
|
|
|
90
|
strict->import; |
17
|
16
|
|
|
|
|
756
|
warnings->import; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub attr { |
21
|
50
|
|
|
50
|
0
|
86
|
my ( $caller, $k, $v ) = @_; |
22
|
5
|
|
|
5
|
|
26
|
no strict 'refs'; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
640
|
|
23
|
50
|
100
|
|
|
|
58
|
return if defined *{"${caller}::$k"}; |
|
50
|
|
|
|
|
313
|
|
24
|
48
|
|
|
|
|
279
|
*{"${caller}::$k"} = sub { |
25
|
51
|
|
|
51
|
|
1343
|
my ( $self, $value ) = @_; |
26
|
51
|
100
|
|
|
|
126
|
if ( !$value ) { |
27
|
48
|
100
|
|
|
|
180
|
$self->{$k} = $v if !$self->{$k}; |
28
|
48
|
|
|
|
|
222
|
return $self->{$k}; |
29
|
|
|
|
|
|
|
} |
30
|
3
|
50
|
|
|
|
17
|
$self->{$k} = $value if $value; |
31
|
48
|
|
|
|
|
164
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |