| 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
| |||||||||||
| 29 | 52 | return $self->_actions->get($name); | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 1 | croak "Can't find action '$name'"; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 33 | 1; | |||||||||
| 36 | __END__ | ||||||||||