Shipment/Package.pm

filter: Statementstmt 97.4% 38 / 39 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod n/a totaltotal 95.9% 47 / 49 CC 1 SCAR 1.0
CC
1
Cov
97%
_build_goods_value
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Shipment/Label.pm ↑ Summary Shipment/Purolator.pm »
1 package Shipment::Package;
2 12 $Shipment::Package::VERSION = '3.11';
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 12 ▶use Data::Currency;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 12 ▶use MooX::Types::MooseLike::Base qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 12 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 12 has 'id' => (
15 is => 'rw',
16 isa => Str,
17 );
18  
19  
20 12 has 'type' => (
21 is => 'rw',
22 isa => Str,
23 );
24  
25  
26 12 has 'name' => (
27 is => 'rw',
28 isa => Str,
29 );
30  
31  
32 12 has 'notes' => (
33 is => 'rw',
34 isa => Str,
35 );
36  
37  
38 12 has 'fragile' => (
39 is => 'rw',
40 isa => Bool,
41 default => 0,
42 );
43  
44  
45 12 has 'weight' => (
46 is => 'rw',
47 isa => Num,
48 );
49  
50  
51 12 has 'length' => (
52 is => 'rw',
53 isa => Num,
54 );
55  
56 12 has 'width' => (
57 is => 'rw',
58 isa => Num,
59 );
60  
61 12 has 'height' => (
62 is => 'rw',
63 isa => Num,
64 );
65  
66  
67 has 'insured_value' => (
68 is => 'rw',
69 isa => InstanceOf ['Data::Currency'],
70 1 ▶ default => sub { Data::Currency->new(0) },
Subroutine __ANON__: called CC=1 SCAR=0.0
71 12 );
72  
73  
74 12 has 'goods_value' => (
75 is => 'rw',
76 isa => InstanceOf ['Data::Currency'],
77 lazy => 1,
78 builder => 1,
79 );
80  
81 0 ▶sub _build_goods_value {
Subroutine _build_goods_value: not called CC=1 SCAR=6.9
82 0 return shift->insured_value;
83 }
84  
85  
86 12 has 'label' => (
87 is => 'rw',
88 isa => InstanceOf ['Shipment::Label'],
89 );
90  
91  
92 12 has 'tracking_id' => (
93 is => 'rw',
94 isa => Str,
95 );
96  
97  
98 has 'cost' => (
99 is => 'rw',
100 isa => InstanceOf ['Data::Currency'],
101 1 ▶ default => sub { Data::Currency->new(0) },
Subroutine __ANON__: called CC=1 SCAR=0.0
102 12 );
103  
104  
105 has 'items' => (
106 handles_via => 'Array',
107 is => 'rw',
108 isa => ArrayRef [HashRef],
109 1 ▶ default => sub { [] }
Subroutine __ANON__: called CC=1 SCAR=0.0
110 12 );
111  
112  
113 12 1;
114  
115 __END__
« Shipment/Label.pm ↑ Summary Shipment/Purolator.pm »