Core/Handler/HandlerDictionary.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 36 CC 1 SCAR 6.9
CC
1
Cov
0%
add_handler_to_dict
2.0
get_handler
2.0
BEGIN
2.0
CRAP 2.0
1 package Javonet::Core::Handler::HandlerDictionary;
2 use strict;
3 use warnings FATAL => 'all';
4 use lib 'lib';
5 use Moose;
6 use Exporter qw(import);
7 our @EXPORT = qw(add_handler_to_dict get_handler);
8
9 our %handler_dict;
10
11 sub add_handler_to_dict {
12 my $command_type = shift;
13 my $handler = shift;
14 $handler_dict{$command_type} = $handler;
15 }
16
17 sub get_handler {
18 my $command_type = shift;
19 my $handler = $handler_dict{$command_type};
20 return $handler;
21 }
22
23 no Moose;
24 1;