cXML/Description.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 100% 36 / 36 CC 2 SCAR 2.0
CC
2
Cov
100%
to_node
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« cXML/Response/PunchOutSetup.pm ↑ Summary cXML/Utils.pm »
1 =encoding utf-8
2  
3 =head1 NAME
4  
5 Business::cXML::Description - cXML description content
6  
7 =head1 SYNOPSIS
8  
9 use Business::cXML::Description;
10  
11 =head1 DESCRIPTION
12  
13 Object representation of a cXML C<Description>.
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 4 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 package Business::cXML::Description;
31 4 ▶use base qw(Business::cXML::Object);
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 4 ▶use constant NODENAME => 'Description';
Subroutine BEGIN: called CC=1 SCAR=0.0
34 4 ▶use constant PROPERTIES => (
Subroutine BEGIN: called CC=1 SCAR=0.0
35 lang => 'en-US',
36 short => undef,
37 full => '',
38 4 );
39  
40 4 ▶use XML::LibXML::Ferry;
Subroutine BEGIN: called CC=1 SCAR=0.0
41  
42 10 ▶sub from_node {
Subroutine from_node: called CC=1 SCAR=0.0
Pod documented
43 10 my ($self, $el) = @_;
44  
45 10 $el->ferry($self, {
46 'xml:lang' => 'lang',
47 ShortName => 'short',
48 __text => 'full',
49 });
50 }
51  
52 11 ▶sub to_node {
Subroutine to_node: called CC=2 SCAR=6.9
Pod documented
53 11 my ($self, $doc) = @_;
54 11 my $node = $doc->create($self->{_nodeName}, $self->{full}, 'xml:lang' => $self->lang);
55 11 ▶ $node->add('ShortName', $self->{short}) if defined $self->{short};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"short"} 2 9 11
56 11 return $node;
57 }
58  
59 =item C<B<lang>>
60  
61 Mandatory, language used, default C<en-US>
62  
63 =item C<B<short>>
64  
65 Optional, shorter version of the full description
66  
67 =item C<B<full>>
68  
69 Mandatory, full description text
70  
71 =back
72  
73 =head1 AUTHOR
74  
75 Stéphane Lavergne L<https://github.com/vphantom>
76  
77 =head1 ACKNOWLEDGEMENTS
78  
79 Graph X Design Inc. L<https://www.gxd.ca/> sponsored this project.
80  
81 =head1 COPYRIGHT & LICENSE
82  
83 Copyright (c) 2017-2018 Stéphane Lavergne L<https://github.com/vphantom>
84  
85 Permission is hereby granted, free of charge, to any person obtaining a copy
86 of this software and associated documentation files (the "Software"), to deal
87 in the Software without restriction, including without limitation the rights
88 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
89 copies of the Software, and to permit persons to whom the Software is
90 furnished to do so, subject to the following conditions:
91  
92 The above copyright notice and this permission notice shall be included in all
93 copies or substantial portions of the Software.
94  
95 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
96 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
97 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
98 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
99 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
100 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
101 SOFTWARE.
102  
103 =cut
104  
105 4 1;
« cXML/Response/PunchOutSetup.pm ↑ Summary cXML/Utils.pm »