UPS/Rate.pm

filter: Statementstmt 96.7% 30 / 31 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 92.5% 37 / 40 CC 2 SCAR 2.7
CC
2
Cov
94%
BUILDARGS
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« UPS/Label.pm ↑ Summary UPS/Response/ShipmentBase.pm »
1 package Net::Async::Webservice::UPS::Rate;
2 5 $Net::Async::Webservice::UPS::Rate::VERSION = '1.1.4';
3 {
4 5 $Net::Async::Webservice::UPS::Rate::DIST = 'Net-Async-Webservice-UPS';
5 }
6 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use Types::Standard qw(Str ArrayRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use Net::Async::Webservice::UPS::Types ':types';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 # ABSTRACT: shipment rate from UPS
13  
14  
15 5 has unit => (
16 is => 'ro',
17 isa => WeightMeasurementUnit,
18 required => 1,
19 );
20  
21  
22 5 has billing_weight => (
23 is => 'ro',
24 isa => Measure,
25 required => 0,
26 );
27  
28  
29 5 has total_charges_currency => (
30 is => 'ro',
31 isa => Currency,
32 required => 1,
33 );
34  
35  
36 5 has total_charges => (
37 is => 'ro',
38 isa => Measure,
39 required => 1,
40 );
41  
42  
43 5 has rated_package => (
44 is => 'ro',
45 isa => Package,
46 required => 1,
47 );
48  
49  
50 5 has service => (
51 is => 'rwp',
52 isa => Service,
53 weak_ref => 1,
54 required => 0,
55 );
56  
57  
58 5 has from => (
59 is => 'ro',
60 isa => Address,
61 required => 1,
62 );
63  
64  
65 5 has to => (
66 is => 'ro',
67 isa => Address,
68 required => 1,
69 );
70  
71 25 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=2 SCAR=7.4
Pod undocumented
72 25 my ($class,@etc) = @_;
73 25 my $hashref = $class->next::method(@etc);
74  
75 25 ▶ if ($hashref->{BillingWeight}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($hashref->{'BillingWeight'}) { } 25 0 25
76 return {
77 billing_weight => $hashref->{BillingWeight}{Weight},
78 unit => $hashref->{BillingWeight}{UnitOfMeasurement}{Code},
79 total_charges => $hashref->{TotalCharges}{MonetaryValue},
80 total_charges_currency => $hashref->{TotalCharges}{CurrencyCode},
81 weight => $hashref->{Weight},
82 rated_package => $hashref->{rated_package},
83 from => $hashref->{from},
84 to => $hashref->{to},
85 }
86 25 }
87 else {
88 0 return $hashref,
89 }
90 }
91  
92 5 1;
93  
94 __END__
« UPS/Label.pm ↑ Summary UPS/Response/ShipmentBase.pm »