lib/Power/Outlet/Common/IP.pm

filter: Statementstmt 82.6% 19 / 23 Branchbran 100% 8 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod 100% 2 / 2 totaltotal 82.9% 34 / 41 CC 5 SCAR 8.1
CC
5
Cov
87%
host
3.0
port
3.0
_host_default
2.0
CRAP 2.2
« lib/Power/Outlet/Virtual.pm ↑ Summary lib/Power/Outlet/OpenBeken.pm »
1 package Power::Outlet::Common::IP;
2 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use base qw{Power::Outlet::Common};
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 15 our $VERSION = '0.54';
7  
8 =head1 NAME
9  
10 Power::Outlet::Common::IP - Power::Outlet base class for Internet Protocol power outlet
11  
12 =head1 SYNOPSIS
13  
14 use base qw{Power::Outlet::Common::IP};
15  
16 =head1 DESCRIPTION
17
18 Power::Outlet::Common::IP is a base package for controlling and querying Internet based power outlet.
19  
20 =head1 USAGE
21  
22 use base qw{Power::Outlet::Common::IP};
23  
24 =head1 CONSTRUCTOR
25  
26 =head1 PROPERTIES
27  
28 =head2 host
29  
30 Sets and returns the hostname or IP address.
31  
32 Manufacturer Default: 192.168.1.254
33  
34 =cut
35  
36 14 ▶sub host {
Subroutine host: called CC=3 SCAR=11.0
Pod documented
37 14 my $self=shift;
38 14 ▶ $self->{"host"}=shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 4 10 14
39 14 ▶ $self->{"host"}=$self->_host_default unless defined $self->{"host"};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"host"} 4 10 14
40 14 return $self->{"host"};
41 }
42  
43 0 ▶sub _host_default {"192.168.1.254"}; #MFG Default for iBoot
Subroutine _host_default: not called CC=1 SCAR=6.9
44  
45 =head2 port
46  
47 Sets and returns the TCP port
48  
49 Manufacturer Default: 80
50  
51 =cut
52  
53 15 ▶sub port {
Subroutine port: called CC=3 SCAR=11.0
Pod documented
54 15 my $self=shift;
55 15 ▶ $self->{"port"}=shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 2 13 15
56 15 ▶ $self->{"port"}=$self->_port_default unless defined $self->{"port"};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"port"} 7 8 15
57 15 return $self->{"port"};
58 }
59  
60 0 ▶sub _port_default {"80"}; #MFG Default for iBoot
Subroutine _port_default: not called CC=1 SCAR=6.9
61  
62 0 ▶sub _name_default {
Subroutine _name_default: not called CC=1 SCAR=6.9
63 0 my $self=shift;
64 0 return $self->host;
65 }
66  
67 =head1 BUGS
68  
69 Please log on RT and send an email to the author.
70  
71 =head1 SUPPORT
72  
73 DavisNetworks.com supports all Perl applications including this package.
74  
75 =head1 AUTHOR
76  
77 Michael R. Davis
78 CPAN ID: MRDVT
79 DavisNetworks.com
80  
81 =head1 COPYRIGHT
82  
83 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
84  
85 The full text of the license can be found in the LICENSE file included with this module.
86  
87 =head1 SEE ALSO
88  
89 =cut
90  
91 15 1;
« lib/Power/Outlet/Virtual.pm ↑ Summary lib/Power/Outlet/OpenBeken.pm »