Easypost/Rate.pm

filter: Statementstmt 72.2% 13 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 2 / 2 totaltotal 76.9% 20 / 26 SCAR 0.2
CC
1
Cov
72%
clone
2.0
BEGIN
1.0
_build_fieldnames
1.0
CRAP 1.0
« Easypost/Parcel.pm ↑ Summary Easypost/CustomsItem.pm »
1 package Net::Easypost::Rate;
2 6 $Net::Easypost::Rate::VERSION = '0.20';
3 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 with qw(Net::Easypost::Resource);
5  
6 6 has 'carrier' => (
7 is => 'ro',
8 default => 'USPS',
9 );
10  
11 6 has [qw/service rate shipment_id/] => (
12 is => 'ro',
13 );
14  
15 sub _build_fieldnames {
16 19 ▶ return [qw(carrier service rate shipment_id)];
Subroutine _build_fieldnames: called CC=1 SCAR=0.0
17 }
18 19 ▶sub _build_role { 'rate' }
Subroutine _build_role: called CC=1 SCAR=0.0
19 19 ▶sub _build_operation { '' }
Subroutine _build_operation: called CC=1 SCAR=0.0
20  
21 sub serialize {
22 2 ▶ my ($self) = @_;
Subroutine serialize: called CC=1 SCAR=0.0
Pod documented
23  
24 return {
25 2 'rate[id]' => $self->id
26 };
27 }
28  
29 sub clone {
30 0 ▶ my ($self) = @_;
Subroutine clone: not called CC=1 SCAR=6.9
Pod documented
31  
32 return Net::Easypost::Rate->new(
33 0 map { $_ => $self->$_ }
34 0 grep { defined $self->$_ }
35 0 'id', @{ $self->fieldnames }
36 );
37 }
38  
39 6 1;
40  
41 __END__
« Easypost/Parcel.pm ↑ Summary Easypost/CustomsItem.pm »