GPSD3/Return/DEVICES.pm

filter: Statementstmt 100% 22 / 22 Branchbran 87.5% 7 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 97.3% 36 / 37 CC 5 SCAR 8.5
CC
5
Cov
97%
devices
3.0
Devices
3.0
BEGIN
1.0
CRAP 2.3
« GPSD3/Cache.pm ↑ Summary GPSD3/Return/SKY.pm »
1 package Net::GPSD3::Return::DEVICES;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use base qw{Net::GPSD3::Return::Unknown};
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION='0.12';
7  
8 =head1 NAME
9  
10 Net::GPSD3::Return::DEVICES - Net::GPSD3 Return DEVICES Object
11  
12 =head1 SYNOPSIS
13  
14 =head1 DESCRIPTION
15  
16 Provides a Perl object interface to the DEVICE object returned by the GPSD daemon.
17  
18 =head1 METHODS
19  
20 =head2 class
21  
22 Returns the object class
23  
24 =head2 string
25  
26 Returns the JSON string
27  
28 =head2 parent
29  
30 Return the parent Net::GPSD object
31  
32 =head2 devices
33  
34 Returns a list of device data structures.
35  
36 my @device=$devices->devices; #({},...)
37 my @device=$devices->devices; #[{},...]
38  
39 =cut
40  
41 3 ▶sub devices {
Subroutine devices: called CC=3 SCAR=11.0
Pod documented
42 3 my $self=shift;
43 3 ▶ $self->{"devices"}=[] unless ref($self->{"devices"}) eq "ARRAY";
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self->{"devices"} eq "ARRAY" 0 3 3
44 3 ▶ return wantarray ? @{$self->{"devices"}} : $self->{"devices"};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 2 1 3
45 }
46  
47 =head2 Devices
48  
49 Returns a list of L<Net::GPSD3::Return::DEVICES> objects.
50  
51 my @device=$devices->Devices; #(bless{},...)
52 my @device=$devices->Devices; #[bless{},...]
53  
54 =cut
55  
56 2 ▶sub Devices {
Subroutine Devices: called CC=3 SCAR=11.0
Pod documented
57 2 my $self=shift;
58 2 ▶ unless (defined $self->{"Devices"}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"Devices"}) 1 1 2
59 $self->{"Devices"}=[
60 1 map {$self->parent->constructor(%$_, string=>$self->parent->encode($_))}
61 1 grep {ref($_) eq "HASH"} $self->devices];
62 }
63 2 ▶ return wantarray ? @{$self->{"Devices"}} : $self->{"Devices"};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 1 1 2
64 }
65  
66 =head1 BUGS
67  
68 Log on RT and Send to gpsd-dev email list
69  
70 =head1 SUPPORT
71  
72 DavisNetworks.com supports all Perl applications including this package.
73  
74 Try gpsd-dev email list
75  
76 =head1 AUTHOR
77  
78 Michael R. Davis
79 CPAN ID: MRDVT
80 STOP, LLC
81 domain=>michaelrdavis,tld=>com,account=>perl
82 http://www.stopllc.com/
83  
84 =head1 COPYRIGHT
85  
86 This program is free software licensed under the...
87  
88 The BSD License
89  
90 The full text of the license can be found in the LICENSE file included with this module.
91  
92 =head1 SEE ALSO
93  
94 L<Net::GPSD3>, L<Net::GPSD3::Return::Unknown>
95  
96 =cut
97  
98 2 1;
« GPSD3/Cache.pm ↑ Summary GPSD3/Return/SKY.pm »