| 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 | 2 | ▶ | use 5.014; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 28 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | |||
| 30 | package Business::cXML::Carrier; | ||
| 31 | 2 | ▶ | use base qw(Business::cXML::Object); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 32 | |||
| 33 | 2 | ▶ | use constant NODENAME => 'CarrierIdentifier'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | 2 | ▶ | use constant PROPERTIES => ( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | domain => 'companyName', | ||
| 36 | id => '', | ||
| 37 | 2 | ); | |
| 38 | |||
| 39 | 2 | ▶ | use XML::LibXML::Ferry; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 40 | |||
| 41 | 2 | ▶ | sub from_node { |
|
Subroutine
from_node: called CC=1 SCAR=0.0
Pod
documented
| |||
| 42 | 2 | my ($self, $el) = @_; | |
| 43 | |||
| 44 | 2 | $el->ferry($self, { __text => 'id' }); | |
| 45 | } | ||
| 46 | |||
| 47 | 1 | ▶ | sub to_node { |
|
Subroutine
to_node: called CC=1 SCAR=0.0
Pod
documented
| |||
| 48 | 1 | my ($self, $doc) = @_; | |
| 49 | 1 | return $doc->create($self->{_nodeName}, $self->{id}, domain => $self->{domain}); | |
| 50 | } | ||
| 51 | |||
| 52 | =item C<B<domain>> | ||
| 53 | |||
| 54 | Mandatory, one of: C<companyName> (default), C<SCAC>, C<IATA>, C<AAR>, C<UIC>, | ||
| 55 | C<EAN>, C<DUNS> | ||
| 56 | |||
| 57 | =item C<B<id>> | ||
| 58 | |||
| 59 | Mandatory, carrier identification | ||
| 60 | |||
| 61 | =back | ||
| 62 | |||
| 63 | =head1 AUTHOR | ||
| 64 | |||
| 65 | Stéphane Lavergne L<https://github.com/vphantom> | ||
| 66 | |||
| 67 | =head1 ACKNOWLEDGEMENTS | ||
| 68 | |||
| 69 | Graph X Design Inc. L<https://www.gxd.ca/> sponsored this project. | ||
| 70 | |||
| 71 | =head1 COPYRIGHT & LICENSE | ||
| 72 | |||
| 73 | Copyright (c) 2017-2018 Stéphane Lavergne L<https://github.com/vphantom> | ||
| 74 | |||
| 75 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 76 | of this software and associated documentation files (the "Software"), to deal | ||
| 77 | in the Software without restriction, including without limitation the rights | ||
| 78 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 79 | copies of the Software, and to permit persons to whom the Software is | ||
| 80 | furnished to do so, subject to the following conditions: | ||
| 81 | |||
| 82 | The above copyright notice and this permission notice shall be included in all | ||
| 83 | copies or substantial portions of the Software. | ||
| 84 | |||
| 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 86 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 87 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 88 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 89 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 90 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 91 | SOFTWARE. | ||
| 92 | |||
| 93 | =cut | ||
| 94 | |||
| 95 | 2 | 1; | |