Conveyor/Ticket/Payload/Instruction/Factory.pm

filter: Statementstmt 73.0% 19 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 72.9% 27 / 37 CC 2 SCAR 7.5
CC
2
Cov
68%
gen_instruction
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« Conveyor/Ticket/Payload/Item.pm ↑ Summary Conveyor/Service/Result/Scalar.pm »
1 1 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Data::Conveyor::Ticket::Payload::Instruction::Factory;
6 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 $Data::Conveyor::Ticket::Payload::Instruction::Factory::VERSION = '1.103130';
8 }
9 # ABSTRACT: Stage-based conveyor-belt-like ticket handling system
10  
11 # ptags: DCTPIF
12 1 ▶use Error::Hierarchy::Util 'assert_defined';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use parent 'Class::Scaffold::Factory';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use constant INSTRUCTION_CLASS_FOR_NAME =>
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 (clear => 'Data::Conveyor::Ticket::Payload::Instruction::Clear',);
16  
17 0 ▶sub gen_instruction {
Subroutine gen_instruction: not called CC=2 SCAR=17.9
Pod documented
18 0 my ($self, $name, %args) = @_;
19 0 assert_defined $name, 'instruction name';
20  
21 # Some instruction classes have a generic structure, they're called
22 # Data::Conveyor::Ticket::Payload::Instruction::value_person_organization
23 # and such. They're generated in Data::Conveyor::Environment, so they're
24 # not in file, so we don't need to load_class() them.
25 0 ▶ if (grep { $_ eq $name } $self->delegate->generic_instruction_classes) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {$_ eq $name;} $self->delegate->generic_instruction_classes) { } 0 0 0
26 0 my $class = $self->delegate->INSTRUCTION_CLASS_BASE() . '::' . $name;
27 0 return $class->new(
28 storage_type => $self->storage_type,
29 %args
30 );
31 } else {
32  
33 # If it is not a generic value object instruction, go through the
34 # normal way of generatic an object.
35 0 return $self->gen_handler(INSTRUCTION_CLASS_FOR_NAME => [$name], %args);
36 }
37 }
38 1 1;
39  
40  
41 __END__
« Conveyor/Ticket/Payload/Item.pm ↑ Summary Conveyor/Service/Result/Scalar.pm »