line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
8
|
|
|
8
|
|
104
|
use 5.006; |
|
8
|
|
|
|
|
17
|
|
2
|
8
|
|
|
8
|
|
28
|
use strict; |
|
8
|
|
|
|
|
8
|
|
|
8
|
|
|
|
|
124
|
|
3
|
8
|
|
|
8
|
|
25
|
use warnings; |
|
8
|
|
|
|
|
10
|
|
|
8
|
|
|
|
|
234
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
EJS::Template::Base - Base class for some EJS::Template classes to hold common config |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=cut |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package EJS::Template::Base; |
12
|
|
|
|
|
|
|
|
13
|
8
|
|
|
8
|
|
25
|
use Scalar::Util qw(reftype); |
|
8
|
|
|
|
|
7
|
|
|
8
|
|
|
|
|
1472
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 Methods |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head2 new |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Common constructor with the config |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub new { |
24
|
274
|
|
|
274
|
1
|
277
|
my ($class, $config) = @_; |
25
|
274
|
50
|
|
|
|
483
|
$config = {} unless ref $config; |
26
|
274
|
|
|
|
|
318
|
$config = {map {$_ => $config->{$_}} @EJS::Template::CONFIG_KEYS}; |
|
548
|
|
|
|
|
1082
|
|
27
|
274
|
|
|
|
|
1182
|
return bless {config => $config}, $class; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head2 config |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Retrieves the config value. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub config { |
37
|
166
|
|
|
166
|
1
|
159
|
my $self = shift; |
38
|
166
|
|
|
|
|
166
|
my $config = $self->{config}; |
39
|
|
|
|
|
|
|
|
40
|
166
|
|
|
|
|
269
|
for my $name (@_) { |
41
|
83
|
50
|
50
|
|
|
327
|
if ((reftype($config) || '') eq 'HASH') { |
42
|
83
|
|
|
|
|
180
|
$config = $config->{$name}; |
43
|
|
|
|
|
|
|
} else { |
44
|
0
|
|
|
|
|
0
|
return undef; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
166
|
|
|
|
|
792
|
return $config; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SEE ALSO |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=over 4 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item * L |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=back |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |