line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POE::Component::SmokeBox::Smoker; |
2
|
|
|
|
|
|
|
$POE::Component::SmokeBox::Smoker::VERSION = '0.56'; |
3
|
|
|
|
|
|
|
#ABSTRACT: encapsulates a smoker object. |
4
|
|
|
|
|
|
|
|
5
|
21
|
|
|
21
|
|
1716020
|
use strict; |
|
21
|
|
|
|
|
113
|
|
|
21
|
|
|
|
|
621
|
|
6
|
21
|
|
|
21
|
|
115
|
use warnings; |
|
21
|
|
|
|
|
45
|
|
|
21
|
|
|
|
|
687
|
|
7
|
21
|
|
|
21
|
|
5205
|
use Params::Check qw(check); |
|
21
|
|
|
|
|
42881
|
|
|
21
|
|
|
|
|
1130
|
|
8
|
21
|
|
|
21
|
|
145
|
use base qw(Object::Accessor); |
|
21
|
|
|
|
|
45
|
|
|
21
|
|
|
|
|
6403
|
|
9
|
21
|
|
|
21
|
|
82268
|
use vars qw($VERBOSE); |
|
21
|
|
|
|
|
81
|
|
|
21
|
|
|
|
|
8598
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
54
|
|
|
54
|
1
|
10609
|
my $package = shift; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $tmpl = { |
15
|
|
|
|
|
|
|
perl => { defined => 1, required => 1 }, |
16
|
0
|
0
|
|
0
|
|
0
|
env => { defined => 1, allow => [ sub { return 1 if ref $_[0] eq 'HASH'; } ], }, |
17
|
4
|
50
|
33
|
4
|
|
499
|
do_callback => { allow => sub { return 1 if ! defined $_[0] or $_[0]->isa( 'CODE' ); }, }, |
18
|
2
|
|
|
2
|
|
211
|
name => { allow => sub { return 1; }, }, |
19
|
54
|
|
|
|
|
640
|
}; |
20
|
|
|
|
|
|
|
|
21
|
54
|
50
|
|
|
|
285
|
my $args = check( $tmpl, { @_ }, 1 ) or return; |
22
|
54
|
|
|
|
|
5208
|
my $self = bless { }, $package; |
23
|
|
|
|
|
|
|
my $accessor_map = { |
24
|
54
|
|
|
54
|
|
2392
|
perl => sub { defined $_[0]; }, |
25
|
0
|
0
|
|
0
|
|
0
|
env => sub { return 1 if ref $_[0] eq 'HASH'; }, |
26
|
4
|
50
|
33
|
4
|
|
404
|
do_callback => sub { return 1 if ! defined $_[0] or $_[0]->isa( 'CODE' ) }, |
27
|
2
|
|
|
2
|
|
137
|
name => sub { return 1; }, |
28
|
54
|
|
|
|
|
584
|
}; |
29
|
54
|
|
|
|
|
330
|
$self->mk_accessors( $accessor_map ); |
30
|
54
|
|
|
|
|
2418
|
$self->$_( $args->{$_} ) for keys %{ $args }; |
|
54
|
|
|
|
|
467
|
|
31
|
54
|
|
|
|
|
5047
|
return $self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub dump_data { |
35
|
85
|
|
|
85
|
1
|
7974
|
my $self = shift; |
36
|
85
|
|
|
|
|
594
|
my @returns = qw(perl); |
37
|
85
|
|
|
|
|
469
|
foreach my $data ( qw( env do_callback ) ) { |
38
|
170
|
100
|
|
|
|
9644
|
push @returns, $data if defined $self->$data; |
39
|
|
|
|
|
|
|
} |
40
|
85
|
|
|
|
|
7415
|
return map { ( $_ => $self->$_ ) } @returns; |
|
89
|
|
|
|
|
777
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |