Pluggable/StyleMap.pm

filter: Statementstmt 62.0% 18 / 29 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 44.6% 25 / 56 CC 8 SCAR 37.3
CC
8
Cov
42%
node
72.0
type
2.0
BEGIN
1.0
CRAP 41.6
« Pluggable/Placemark.pm ↑ Summary Pluggable/NetworkLink.pm »
1 package Geo::GoogleEarth::Pluggable::StyleMap;
2 1 ▶use base qw{Geo::GoogleEarth::Pluggable::StyleBase};
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Scalar::Util qw{blessed};
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use XML::LibXML::LazyBuilder qw{E};
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION='0.17';
9 1 our $PACKAGE=__PACKAGE__;
10  
11 =head1 NAME
12  
13 Geo::GoogleEarth::Pluggable::StyleMap - Geo::GoogleEarth::Pluggable StyleMap Object
14  
15 =head1 SYNOPSIS
16  
17 use Geo::GoogleEarth::Pluggable;
18 my $document=Geo::GoogleEarth::Pluggable->new;
19 my $style=$document->StyleMap(%data);
20 print $document->render;
21  
22 =head1 DESCRIPTION
23  
24 Geo::GoogleEarth::Pluggable::StyleMap is a L<Geo::GoogleEarth::Pluggable::Base> with a few other methods.
25  
26 =head1 USAGE
27  
28 my $style=$document->StyleMap(
29 normal => $style1,
30 highlight => $style2,
31 );
32  
33 =head1 CONSTRUCTOR
34  
35 =head2 new
36  
37 my $style=$document->StyleMap;
38  
39 =head1 METHODS
40  
41 =head2 type
42  
43 Returns the object type.
44  
45 my $type=$style->type;
46  
47 =cut
48  
49 0 ▶sub type {"StyleMap"};
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
50  
51 =head2 node
52  
53 Generates XML that looks like this.
54  
55 <StyleMap id="StyleMap-perl-69">
56 <Pair>
57 <key>normal</key>
58 <styleUrl>#Style-perl-19</styleUrl>
59 </Pair>
60 <Pair>
61 <key>highlight</key>
62 <styleUrl>#Style-perl-11</styleUrl>
63 </Pair>
64 </StyleMap>
65  
66 =cut
67  
68 0 ▶sub node {
Subroutine node: not called CC=8 SCAR=42.8
Pod documented
69 0 my $self=shift;
70 0 my @element=();
71 0 foreach my $key (keys %$self) {
72 #$key should be either "normal" or "highlight"
73 0 ▶ next if $key eq "document";
Branch: 1 branch
BranchTrueFalseTotal
if $key eq "document" 0 0 0
74 0 ▶ next if $key eq "id";
Branch: 1 branch
BranchTrueFalseTotal
if $key eq "id" 0 0 0
75 0 ▶ my $value=$self->{$key}||'';
Condition0%0/2
$self->{$key} || ''
l!l
00
MC/DC0%0/1
$self->{$key} || ''
$self->{$key}
Truth table0%0/2
A
A= $self->{$key}
Aresult
11
00
76 0 ▶ if (blessed($value) and $value->can("type") and $value->type=~m/^Style/) {
Branch: 1 branch
BranchTrueFalseTotal
if (builtin::blessed($value) and $value->can("type") and $value->type =~ /^Style/) 0 0 0
Condition0%0/6
builtin::blessed($value) and $value->can("type") and $value->type =~ /^Style/
!ll&&!rl&&r
000
builtin::blessed($value) and $value->can("type")
!ll&&!rl&&r
000
MC/DC0%0/3
builtin::blessed($value) and $value->can("type") and $value->type =~ /^Style/
builtin::blessed($value) $value->can("type") $value->type =~ /^Style/
Truth table0%0/4
A and B and C
A= builtin::blessed($value)B= $value->can("type")C= $value->type =~ /^Style/
ABCresult
0XX0
10X0
1100
1111
77 0 $value=$value->url;
78 }
79 0 push @element, E(Pair=>{}, E(key=>{}, $key), E(styleUrl=>{}, $value));
80 }
81 0 return E(StyleMap=>{id=>$self->id}, @element);
82 }
83  
84 =head1 BUGS
85  
86 Please log on RT and send to the geo-perl email list.
87  
88 =head1 SUPPORT
89  
90 Try geo-perl email list.
91  
92 =head1 AUTHOR
93  
94 Michael R. Davis (mrdvt92)
95 CPAN ID: MRDVT
96  
97 =head1 COPYRIGHT
98  
99 This program is free software licensed under the...
100  
101 The BSD License
102  
103 The full text of the license can be found in the
104 LICENSE file included with this module.
105  
106 =head1 SEE ALSO
107  
108 L<Geo::GoogleEarth::Pluggable>, L<XML::LibXML::LazyBuilder>, L<Scalar::Util>
109  
110 =cut
111  
112 1 1;
« Pluggable/Placemark.pm ↑ Summary Pluggable/NetworkLink.pm »