File Coverage

blib/lib/Business/UPS/Tracking/Shipment/SmallPackage.pm
Criterion Covered Total %
statement 14 21 66.6
branch n/a
condition n/a
subroutine 5 7 71.4
pod 1 1 100.0
total 20 29 68.9


line stmt bran cond sub pod time code
1             # ============================================================================
2             package Business::UPS::Tracking::Shipment::SmallPackage;
3             # ============================================================================
4 1     1   5 use utf8;
  1         2  
  1         6  
5 1     1   51 use 5.0100;
  1         3  
6              
7 1     1   4 use Moose;
  1         2  
  1         6  
8             extends 'Business::UPS::Tracking::Shipment';
9              
10 1     1   5148 use Business::UPS::Tracking::Element::Package;
  1         3  
  1         146  
11              
12             =encoding utf8
13              
14             =head1 NAME
15              
16             Business::UPS::Tracking::Shipment::SmallPackage - A small package shipment
17              
18             =head1 DESCRIPTION
19              
20              
21             This class represents an small package shipment and extends
22             L<Business::UPS::Tracking::Shipment>. Usually it is created
23             automatically from a L<Business::UPS::Tracking::Response> object.
24              
25             =head1 ACCESSORS
26              
27             Same as L<Business::UPS::Tracking::Shipment>
28              
29             =head2 Package
30              
31             List of packages (L<Business::UPS::Tracking::Element::Package>)
32              
33             =cut
34              
35             has 'Package' => (
36             is => 'ro',
37             isa => 'ArrayRef[Business::UPS::Tracking::Element::Package]',
38             traits => ['Printable'],
39             documentation => 'Package',
40             lazy_build => 1,
41             );
42              
43             sub _build_Package {
44 0     0     my ($self) = @_;
45              
46 0           my @nodes = $self->xml->findnodes('Package');
47 0           my $return = [];
48 0           foreach my $node (@nodes) {
49 0           push @$return,Business::UPS::Tracking::Element::Package->new(
50             xml => $node,
51             );
52             }
53 0           return $return;
54             }
55              
56              
57              
58             =head1 METHODS
59              
60             =head2 ShipmentType
61              
62             Returns 'Small Package'
63              
64             =cut
65              
66             sub ShipmentType {
67 0     0 1   return 'Small Package';
68             }
69              
70             =head2 meta
71              
72             Moose meta method
73              
74             =cut
75              
76             __PACKAGE__->meta->make_immutable;
77 1     1   7 no Moose;
  1         2  
  1         5  
78             1;