File Coverage

blib/lib/Geo/GoogleEarth/Pluggable/Base.pm
Criterion Covered Total %
statement 9 25 36.0
branch 0 14 0.0
condition n/a
subroutine 3 7 42.8
pod 4 4 100.0
total 16 50 32.0


line stmt bran cond sub pod time code
1             package Geo::GoogleEarth::Pluggable::Base;
2 5     5   24 use warnings;
  5         9  
  5         113  
3 5     5   22 use strict;
  5         8  
  5         128  
4 5     5   22 use base qw{Geo::GoogleEarth::Pluggable::Constructor};
  5         7  
  5         2536  
5              
6             our $VERSION='0.14';
7              
8             =head1 NAME
9              
10             Geo::GoogleEarth::Pluggable::Base - Geo::GoogleEarth::Pluggable Base package
11              
12             =head1 SYNOPSIS
13              
14             use base qw{Geo::GoogleEarth::Pluggable::Base};
15              
16             =head1 DESCRIPTION
17              
18             The is the base of all Geo::GoogleEarth::Pluggable packages.
19              
20             =head1 USAGE
21              
22             =head1 CONSTRUCTOR
23              
24             =head2 new
25              
26             my $document = Geo::GoogleEarth::Pluggable->new(key1=>value1,
27             key2=>[value=>{opt1=>val1}],
28             key3=>{value=>{opt2=>val2}});
29              
30             =head1 METHODS
31              
32             =head2 name
33              
34             Sets or returns the name property.
35              
36             my $name=$folder->name;
37             $placemark->name("New Name");
38             $document->name("New Name");
39              
40             =cut
41              
42             sub name {
43 0     0 1   my $self=shift;
44 0 0         $self->{'name'}=shift if @_;
45 0           return $self->{'name'};
46             }
47              
48             =head2 description
49              
50             Sets or returns the description property.
51              
52             my $description=$folder->description;
53             $placemark->description("New Description");
54             $document->description("New Description");
55              
56             =cut
57              
58             sub description {
59 0     0 1   my $self=shift;
60 0 0         $self->{'description'}=shift if @_;
61 0           return $self->{'description'};
62             }
63              
64             =head2 Snippet
65              
66             Returns the Snippet used in the Snippet XML element or a Placemark. The default Snippet from Google Earth is to use the first line of the description however this package defaults to a zero line Snippet.
67              
68             Snippet is rendered with maxLines as the length of the array ref and the content joined with new lines.
69              
70             Typical use
71              
72             $document->Point(Snippet=>"Line 1");
73             $document->Point(Snippet=>["Line 1", "Line 2"]);
74              
75             Extended used
76              
77             my $snippet=$placemark->Snippet; #[] always array reference
78             $placemark->Snippet([]); #default
79             $placemark->Snippet(["line 1", "line 2", "line 3"]);
80             $placemark->Snippet("My Snippet Text"); #folded into array reference.
81             $placemark->Snippet("line 1", "line 2", "line 3"); #folded into array reference
82              
83             =cut
84              
85             sub Snippet {
86 0     0 1   my $self=shift;
87 0 0         if (@_ == 1) {
    0          
88 0           $self->{"Snippet"}=shift;
89             } elsif (@_ > 1) {
90 0           $self->{"Snippet"}=[@_];
91             }
92             #force undef to default empty array reference
93 0 0         $self->{"Snippet"}=[] unless defined $self->{"Snippet"};
94             #force to array reference
95 0 0         $self->{"Snippet"}=[$self->{"Snippet"}] unless ref($self->{"Snippet"}) eq "ARRAY";
96 0           return $self->{"Snippet"};
97             }
98            
99             =head2 lookat
100              
101             Sets or returns a L object
102              
103             =cut
104              
105             sub lookat {
106 0     0 1   my $self=shift;
107 0 0         $self->{"lookat"}=shift if @_;
108 0           return $self->{"lookat"};
109             }
110              
111             =head1 BUGS
112              
113             Please log on RT and send to the geo-perl email list.
114              
115             =head1 SUPPORT
116              
117             DavisNetworks.com supports all Perl applications including this package.
118              
119             =head1 AUTHOR
120              
121             Michael R. Davis (mrdvt92)
122             CPAN ID: MRDVT
123              
124             =head1 COPYRIGHT
125              
126             This program is free software licensed under the...
127              
128             The BSD License
129              
130             The full text of the license can be found in the LICENSE file included with this module.
131              
132             =head1 SEE ALSO
133              
134             L creates a GoogleEarth Document.
135              
136             =cut
137              
138             1;