line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ============================================================================ |
2
|
|
|
|
|
|
|
package Business::UPS::Tracking::Element::Code; |
3
|
|
|
|
|
|
|
# ============================================================================ |
4
|
1
|
|
|
1
|
|
9
|
use utf8; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
10
|
|
5
|
1
|
|
|
1
|
|
46
|
use 5.0100; |
|
1
|
|
|
|
|
4
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
7299
|
use Business::UPS::Tracking::Utils; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
192
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=encoding utf8 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Business::UPS::Tracking::Element::Code - Generic container for parameters |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This is a generic container class used to store information constisting |
20
|
|
|
|
|
|
|
of a code and a description |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 ACCESSORS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 xml |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Original L<XML::LibXML::Node> node. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 meta |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Moose meta method |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 Code |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Alphanumeric code |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 Description |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Description string |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
has 'xml' => ( |
43
|
|
|
|
|
|
|
is => 'rw', |
44
|
|
|
|
|
|
|
isa => 'XML::LibXML::Node', |
45
|
|
|
|
|
|
|
required => 1, |
46
|
|
|
|
|
|
|
trigger => \&_build_code, |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
has 'Code' => ( |
49
|
|
|
|
|
|
|
is => 'rw', |
50
|
|
|
|
|
|
|
isa => 'Str', |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
has 'Description' => ( |
53
|
|
|
|
|
|
|
is => 'rw', |
54
|
|
|
|
|
|
|
isa => 'Str', |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _build_code { |
58
|
0
|
|
|
0
|
|
|
my ( $self, $xml ) = @_; |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
$self->Code($xml->findvalue('Code')); |
61
|
0
|
|
|
|
|
|
$self->Description($xml->findvalue('Description')); |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub serialize { |
67
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
if ($self->Description) { |
70
|
0
|
|
|
|
|
|
return $self->Description.' ('.$self->Code.')'; |
71
|
|
|
|
|
|
|
} else { |
72
|
0
|
|
|
|
|
|
return $self->Code; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 METHODS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 printall |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Returns the serialized object content |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 meta |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Moose meta method |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
90
|
1
|
|
|
1
|
|
7
|
no Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
91
|
|
|
|
|
|
|
1; |