RuleEngine/Engine/Actions.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 3 / 3 totaltotal 100% 41 / 41 CC 2 SCAR 1.8
CC
2
Cov
100%
_get_action
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« RuleEngine/Engine/Outputs.pm ↑ Summary RuleEngine/Engine/Inputs.pm »
1 33 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 33 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 33 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 33 ▶use VS::RuleEngine::Engine::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 33 ▶use VS::RuleEngine::TypeDecl;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 66 ▶sub add_action {
Subroutine add_action: called CC=1 SCAR=0.0
Pod documented
10 66 my ($self, $name, $action, $defaults, @args) = @_;
11 66 $self->_check_add_args('Action', \&has_action, $name, $action);
12 57 $self->_actions->set($name => VS::RuleEngine::TypeDecl->new($action, $defaults, @args));
13 }
14  
15 35 ▶sub actions {
Subroutine actions: called CC=1 SCAR=0.0
Pod documented
16 35 my $self = shift;
17 35 return $self->_actions->keys;
18 }
19  
20 167 ▶sub has_action {
Subroutine has_action: called CC=1 SCAR=0.0
Pod documented
21 167 my ($self, $name) = @_;
22 167 return $self->_actions->exists($name);
23 }
24  
25 53 ▶sub _get_action {
Subroutine _get_action: called CC=2 SCAR=6.9
26 53 my ($self, $name) = @_;
27  
28 53 ▶ if ($self->has_action($name)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_action($name)) 52 1 53
29 52 return $self->_actions->get($name);
30 }
31  
32 1 croak "Can't find action '$name'";
33 }
34  
35 33 1;
36 __END__
« RuleEngine/Engine/Outputs.pm ↑ Summary RuleEngine/Engine/Inputs.pm »