| 1 | package Net::FreeDB2::Site; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | # Copyright 2002, Vincenzo Zocca. | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | # See LICENSE section for usage and distribution rights. | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 4 | require 5.005_62; | |||||||||||||||||||
| 8 | 4 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 4 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 4 | require Exporter; | |||||||||||||||||||
| 12 | 4 | ▶ | use AutoLoader qw(AUTOLOAD); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 4 | our @ISA = qw(Exporter); | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | # Items to export into callers namespace by default. Note: do not export | ||||||||||||||||||||
| 17 | # names by default without a very good reason. Use EXPORT_OK instead. | ||||||||||||||||||||
| 18 | # Do not simply export all your public functions/methods/constants. | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | # This allows declaration use Net::FreeDB2::Site ':all'; | ||||||||||||||||||||
| 21 | # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK | ||||||||||||||||||||
| 22 | # will save memory. | ||||||||||||||||||||
| 23 | 4 | our %EXPORT_TAGS = ( 'all' => [ qw( | |||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | ) ] ); | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 4 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 4 | our @EXPORT = qw( | |||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | ); | ||||||||||||||||||||
| 32 | 4 | our ( $VERSION ) = '$Revision: 0.9 $ ' =~ /\$Revision:\s+([^\s]+)/; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 35 | 0 | my $class = shift; | |||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 0 | my $self = {}; | |||||||||||||||||||
| 38 | 0 | ▶ | bless ($self, (ref($class) || $class)); | ||||||||||||||||||
|
Condition0%0/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table0%0/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 39 | 0 | return ($self->_initialize (@_)); | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 0 | ▶ | sub _initialize { | ||||||||||||||||||
|
Subroutine
_initialize: not called CC=7 SCAR=40.3
| |||||||||||||||||||||
| 43 | 0 | my $self = shift; | |||||||||||||||||||
| 44 | 0 | ▶ | my $opt = shift || {}; | ||||||||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 0 | ▶ | defined ($opt->{site}) && $self->setSite ($opt->{site}); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 47 | 0 | ▶ | defined ($opt->{port}) && $self->setPort ($opt->{port}); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 48 | 0 | ▶ | defined ($opt->{latitude}) && $self->setLatitude ($opt->{latitude}); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | 0 | ▶ | defined ($opt->{longitude}) && $self->setLongitude ($opt->{longitude}); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 50 | 0 | ▶ | defined ($opt->{description}) && $self->setDescription ($opt->{description}); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 51 | 0 | return ($self); | |||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 0 | ▶ | sub setSite { | ||||||||||||||||||
|
Subroutine
setSite: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 55 | 0 | my $self = shift; | |||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | 0 | $self->{Net_FreeDB2_Site}{site} = shift; | |||||||||||||||||||
| 58 | } | ||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 0 | ▶ | sub getSite { | ||||||||||||||||||
|
Subroutine
getSite: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 61 | 0 | my $self = shift; | |||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | 0 | return ($self->{Net_FreeDB2_Site}{site}); | |||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 0 | ▶ | sub setPort { | ||||||||||||||||||
|
Subroutine
setPort: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 67 | 0 | my $self = shift; | |||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | 0 | $self->{Net_FreeDB2_Site}{port} = shift; | |||||||||||||||||||
| 70 | } | ||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 0 | ▶ | sub getPort { | ||||||||||||||||||
|
Subroutine
getPort: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 73 | 0 | my $self = shift; | |||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 0 | return ($self->{Net_FreeDB2_Site}{port}); | |||||||||||||||||||
| 76 | } | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | 0 | ▶ | sub setLatitude { | ||||||||||||||||||
|
Subroutine
setLatitude: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 79 | 0 | my $self = shift; | |||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | 0 | $self->{Net_FreeDB2_Site}{latitude} = shift; | |||||||||||||||||||
| 82 | } | ||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | 0 | ▶ | sub getLatitude { | ||||||||||||||||||
|
Subroutine
getLatitude: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 85 | 0 | my $self = shift; | |||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | 0 | return ($self->{Net_FreeDB2_Site}{latitude}); | |||||||||||||||||||
| 88 | } | ||||||||||||||||||||
| 89 | |||||||||||||||||||||
| 90 | 0 | ▶ | sub setLongitude { | ||||||||||||||||||
|
Subroutine
setLongitude: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 91 | 0 | my $self = shift; | |||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | 0 | $self->{Net_FreeDB2_Site}{longitude} = shift; | |||||||||||||||||||
| 94 | } | ||||||||||||||||||||
| 95 | |||||||||||||||||||||
| 96 | 0 | ▶ | sub getLongitude { | ||||||||||||||||||
|
Subroutine
getLongitude: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 97 | 0 | my $self = shift; | |||||||||||||||||||
| 98 | |||||||||||||||||||||
| 99 | 0 | return ($self->{Net_FreeDB2_Site}{longitude}); | |||||||||||||||||||
| 100 | } | ||||||||||||||||||||
| 101 | |||||||||||||||||||||
| 102 | 0 | ▶ | sub setDescription { | ||||||||||||||||||
|
Subroutine
setDescription: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 103 | 0 | my $self = shift; | |||||||||||||||||||
| 104 | |||||||||||||||||||||
| 105 | 0 | $self->{Net_FreeDB2_Site}{description} = shift; | |||||||||||||||||||
| 106 | } | ||||||||||||||||||||
| 107 | |||||||||||||||||||||
| 108 | 0 | ▶ | sub getDescription { | ||||||||||||||||||
|
Subroutine
getDescription: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 109 | 0 | my $self = shift; | |||||||||||||||||||
| 110 | |||||||||||||||||||||
| 111 | 0 | return ($self->{Net_FreeDB2_Site}{description}); | |||||||||||||||||||
| 112 | } | ||||||||||||||||||||
| 113 | |||||||||||||||||||||
| 114 | 4 | 1; | |||||||||||||||||||
| 115 | __END__ | ||||||||||||||||||||