line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
32
|
|
|
32
|
|
170
|
use strict; |
|
32
|
|
|
|
|
60
|
|
|
32
|
|
|
|
|
1095
|
|
2
|
32
|
|
|
32
|
|
165
|
use warnings; |
|
32
|
|
|
|
|
91
|
|
|
32
|
|
|
|
|
969
|
|
3
|
|
|
|
|
|
|
|
4
|
32
|
|
|
32
|
|
177
|
use Carp qw(croak); |
|
32
|
|
|
|
|
54
|
|
|
32
|
|
|
|
|
1426
|
|
5
|
|
|
|
|
|
|
|
6
|
32
|
|
|
32
|
|
627
|
use VS::RuleEngine::Engine::Common; |
|
32
|
|
|
|
|
69
|
|
|
32
|
|
|
|
|
716
|
|
7
|
32
|
|
|
32
|
|
18982
|
use VS::RuleEngine::InputHandler; |
|
32
|
|
|
|
|
79
|
|
|
32
|
|
|
|
|
927
|
|
8
|
32
|
|
|
32
|
|
205
|
use VS::RuleEngine::TypeDecl; |
|
32
|
|
|
|
|
64
|
|
|
32
|
|
|
|
|
11023
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub add_input { |
11
|
65
|
|
|
65
|
1
|
11362
|
my ($self, $name, $input, $defaults, @args) = @_; |
12
|
65
|
|
|
|
|
251
|
$self->_check_add_args('Input', \&has_input, $name, $input); |
13
|
56
|
|
|
|
|
1235
|
$self->_inputs->set($name => VS::RuleEngine::TypeDecl->new($input, $defaults, @args)); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub inputs { |
17
|
36
|
|
|
36
|
1
|
49
|
my $self = shift; |
18
|
36
|
|
|
|
|
848
|
return $self->_inputs->keys; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub has_input { |
22
|
122
|
|
|
122
|
1
|
5525
|
my ($self, $name) = @_; |
23
|
122
|
|
|
|
|
3003
|
return $self->_inputs->exists($name); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub _get_input { |
27
|
56
|
|
|
56
|
|
776
|
my ($self, $name) = @_; |
28
|
|
|
|
|
|
|
|
29
|
56
|
100
|
|
|
|
121
|
if ($self->has_input($name)) { |
30
|
55
|
|
|
|
|
1204
|
return $self->_inputs->get($name); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
15
|
croak "Can't find input '$name'"; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _input_handler { |
37
|
35
|
|
|
35
|
|
61
|
my $self = shift; |
38
|
50
|
|
|
|
|
114
|
my %inputs = map { |
39
|
35
|
|
|
|
|
112
|
my $input = $self->_get_input($_); |
40
|
50
|
|
|
|
|
162
|
$_ => $input->instantiate($self); |
41
|
|
|
|
|
|
|
} $self->inputs; |
42
|
35
|
|
|
|
|
240
|
my $handler = VS::RuleEngine::InputHandler->new(%inputs); |
43
|
35
|
|
|
|
|
119
|
return $handler; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |