File Coverage

blib/lib/Business/cXML/Carrier.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 2 2 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1             =encoding utf-8
2              
3             =head1 NAME
4              
5             Business::cXML::Carrier - cXML carrier identity
6              
7             =head1 SYNOPSIS
8              
9             use Business::cXML::Carrier;
10              
11             =head1 DESCRIPTION
12              
13             Object representation of a cXML C<CarrierIdentifier>.
14              
15             =head1 METHODS
16              
17             See L<Business::cXML::Object/COMMON METHODS>.
18              
19             =head1 PROPERTY METHODS
20              
21             See L<Business::cXML::Object/PROPERTY METHODS> for how the following operate.
22              
23             =over
24              
25             =cut
26              
27 7     7   850 use 5.014;
  7         22  
28 7     7   34 use strict;
  7         11  
  7         227  
29              
30             use base qw(Business::cXML::Object);
31 7     7   33  
  7         13  
  7         420  
32             use constant NODENAME => 'CarrierIdentifier';
33 7     7   38 use constant PROPERTIES => (
  7         15  
  7         406  
34 7         371 domain => 'companyName',
35             id => '',
36             );
37 7     7   38  
  7         13  
38             use XML::LibXML::Ferry;
39 7     7   46  
  7         16  
  7         832  
40             my ($self, $el) = @_;
41              
42 10     10 1 28 $el->ferry($self, { __text => 'id' });
43             }
44 10         48  
45             my ($self, $doc) = @_;
46             return $doc->create($self->{_nodeName}, $self->{id}, domain => $self->{domain});
47             }
48 5     5 1 12  
49 5         22 =item C<B<domain>>
50              
51             Mandatory, one of: C<companyName> (default), C<SCAC>, C<IATA>, C<AAR>, C<UIC>,
52             C<EAN>, C<DUNS>
53              
54             =item C<B<id>>
55              
56             Mandatory, carrier identification
57              
58             =back
59              
60             =head1 AUTHOR
61              
62             Stéphane Lavergne L<https://github.com/vphantom>
63              
64             =head1 ACKNOWLEDGEMENTS
65              
66             Graph X Design Inc. L<https://www.gxd.ca/> sponsored this project.
67              
68             =head1 COPYRIGHT & LICENSE
69              
70             Copyright (c) 2017-2018 Stéphane Lavergne L<https://github.com/vphantom>
71              
72             Permission is hereby granted, free of charge, to any person obtaining a copy
73             of this software and associated documentation files (the "Software"), to deal
74             in the Software without restriction, including without limitation the rights
75             to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
76             copies of the Software, and to permit persons to whom the Software is
77             furnished to do so, subject to the following conditions:
78              
79             The above copyright notice and this permission notice shall be included in all
80             copies or substantial portions of the Software.
81              
82             THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
83             IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
84             FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
85             AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
86             LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
87             OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
88             SOFTWARE.
89              
90             =cut
91              
92             1;