line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hoppy::Base; |
2
|
8
|
|
|
8
|
|
55
|
use strict; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
297
|
|
3
|
8
|
|
|
8
|
|
69
|
use warnings; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
188
|
|
4
|
8
|
|
|
8
|
|
41
|
use Carp; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
846
|
|
5
|
8
|
|
|
8
|
|
43
|
use base qw(Class::Accessor::Fast Class::Data::ConfigHash); |
|
8
|
|
|
|
|
35
|
|
|
8
|
|
|
|
|
8819
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$|++; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors($_) for qw(context); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
71
|
|
|
71
|
1
|
534
|
my $class = shift; |
13
|
71
|
|
|
|
|
232
|
my %args = @_; |
14
|
71
|
|
|
|
|
153
|
my $config = delete $args{config}; |
15
|
71
|
|
|
|
|
775
|
my $self = $class->SUPER::new( {@_} ); |
16
|
71
|
100
|
|
|
|
1139
|
$self->config($config) if $config; |
17
|
71
|
|
|
|
|
921
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub mk_virtual_methods { |
21
|
5
|
|
|
5
|
1
|
17
|
my $class = shift; |
22
|
5
|
|
|
|
|
17
|
foreach my $method (@_) { |
23
|
5
|
|
|
|
|
127
|
my $slot = "${class}::${method}"; |
24
|
|
|
|
|
|
|
{ |
25
|
8
|
|
|
8
|
|
61238
|
no strict 'refs'; |
|
8
|
|
|
|
|
25
|
|
|
8
|
|
|
|
|
1068
|
|
|
5
|
|
|
|
|
13
|
|
26
|
5
|
|
|
|
|
244
|
*{$slot} = sub { |
27
|
0
|
|
|
0
|
|
0
|
Carp::croak( ref( $_[0] ) . "::${method} is not overridden" ); |
28
|
|
|
|
|
|
|
} |
29
|
5
|
|
|
|
|
39
|
} |
30
|
|
|
|
|
|
|
} |
31
|
5
|
|
|
|
|
27
|
return (); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
__END__ |