| 1 | package Geo::Details; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use 5.006; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 1 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=3 SCAR=12.6
Pod
documented
| |||||||||||||
| 8 | 1 | my $class = shift; | |||||||||||
| 9 | 1 | my $data = shift; | |||||||||||
| 10 | 1 | ▶ | my $key = shift // ''; | ||||||||||
|
Condition50%1/2
shift() // ""
MC/DC0%0/1
shift() // ""
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 11 | |||||||||||||
| 12 | # If $data is a hash reference, directly bless it into the class and return. | ||||||||||||
| 13 | 1 | ▶ | if ( ref($data) eq 'HASH' ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 14 | 1 | bless $data, $class; | |||||||||||
| 15 | 1 | return $data; | |||||||||||
| 16 | } | ||||||||||||
| 17 | |||||||||||||
| 18 | # If $data is a plain string, create a new hash reference and set the specified key to the string value. | ||||||||||||
| 19 | # Use the provided key or default to ''. | ||||||||||||
| 20 | 0 | my $self = { $key => $data }; | |||||||||||
| 21 | 0 | bless $self, $class; | |||||||||||
| 22 | 0 | return $self; | |||||||||||
| 23 | } | ||||||||||||
| 24 | |||||||||||||
| 25 | 0 | ▶ | sub TO_JSON { | ||||||||||
|
Subroutine
TO_JSON: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 26 | 0 | my ($self) = @_; | |||||||||||
| 27 | |||||||||||||
| 28 | # Return a copy of the object as a hash reference for JSON encoding | ||||||||||||
| 29 | 0 | return {%$self}; | |||||||||||
| 30 | } | ||||||||||||
| 31 | |||||||||||||
| 32 | 0 | ▶ | sub abuse { | ||||||||||
|
Subroutine
abuse: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 33 | 0 | return $_[0]->{abuse}; | |||||||||||
| 34 | } | ||||||||||||
| 35 | |||||||||||||
| 36 | 0 | ▶ | sub ip { | ||||||||||
|
Subroutine
ip: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 37 | 0 | return $_[0]->{ip}; | |||||||||||
| 38 | } | ||||||||||||
| 39 | |||||||||||||
| 40 | 0 | ▶ | sub org { | ||||||||||
|
Subroutine
org: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 41 | 0 | return $_[0]->{org}; | |||||||||||
| 42 | } | ||||||||||||
| 43 | |||||||||||||
| 44 | 0 | ▶ | sub domains { | ||||||||||
|
Subroutine
domains: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 45 | 0 | return $_[0]->{domains}; | |||||||||||
| 46 | } | ||||||||||||
| 47 | |||||||||||||
| 48 | 0 | ▶ | sub privacy { | ||||||||||
|
Subroutine
privacy: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 49 | 0 | return $_[0]->{privacy}; | |||||||||||
| 50 | } | ||||||||||||
| 51 | |||||||||||||
| 52 | 0 | ▶ | sub timezone { | ||||||||||
|
Subroutine
timezone: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 53 | 0 | return $_[0]->{timezone}; | |||||||||||
| 54 | } | ||||||||||||
| 55 | |||||||||||||
| 56 | 0 | ▶ | sub hostname { | ||||||||||
|
Subroutine
hostname: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 57 | 0 | return $_[0]->{hostname}; | |||||||||||
| 58 | } | ||||||||||||
| 59 | |||||||||||||
| 60 | 0 | ▶ | sub city { | ||||||||||
|
Subroutine
city: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 61 | 0 | return $_[0]->{city}; | |||||||||||
| 62 | } | ||||||||||||
| 63 | |||||||||||||
| 64 | 0 | ▶ | sub region { | ||||||||||
|
Subroutine
region: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 65 | 0 | return $_[0]->{region}; | |||||||||||
| 66 | } | ||||||||||||
| 67 | |||||||||||||
| 68 | 0 | ▶ | sub country { | ||||||||||
|
Subroutine
country: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 69 | 0 | return $_[0]->{country}; | |||||||||||
| 70 | } | ||||||||||||
| 71 | |||||||||||||
| 72 | 0 | ▶ | sub country_name { | ||||||||||
|
Subroutine
country_name: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 73 | 0 | return $_[0]->{country_name}; | |||||||||||
| 74 | } | ||||||||||||
| 75 | |||||||||||||
| 76 | 0 | ▶ | sub country_flag { | ||||||||||
|
Subroutine
country_flag: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 77 | 0 | return $_[0]->{country_flag}; | |||||||||||
| 78 | } | ||||||||||||
| 79 | |||||||||||||
| 80 | 0 | ▶ | sub country_flag_url { | ||||||||||
|
Subroutine
country_flag_url: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 81 | 0 | return $_[0]->{country_flag_url}; | |||||||||||
| 82 | } | ||||||||||||
| 83 | |||||||||||||
| 84 | 0 | ▶ | sub country_currency { | ||||||||||
|
Subroutine
country_currency: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 85 | 0 | return $_[0]->{country_currency}; | |||||||||||
| 86 | } | ||||||||||||
| 87 | |||||||||||||
| 88 | 0 | ▶ | sub continent { | ||||||||||
|
Subroutine
continent: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 89 | 0 | return $_[0]->{continent}; | |||||||||||
| 90 | } | ||||||||||||
| 91 | |||||||||||||
| 92 | 0 | ▶ | sub is_eu { | ||||||||||
|
Subroutine
is_eu: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 93 | 0 | return $_[0]->{is_eu}; | |||||||||||
| 94 | } | ||||||||||||
| 95 | |||||||||||||
| 96 | 0 | ▶ | sub loc { | ||||||||||
|
Subroutine
loc: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 97 | 0 | return $_[0]->{loc}; | |||||||||||
| 98 | } | ||||||||||||
| 99 | |||||||||||||
| 100 | 0 | ▶ | sub latitude { | ||||||||||
|
Subroutine
latitude: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 101 | 0 | return $_[0]->{latitude}; | |||||||||||
| 102 | } | ||||||||||||
| 103 | |||||||||||||
| 104 | 0 | ▶ | sub longitude { | ||||||||||
|
Subroutine
longitude: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 105 | 0 | return $_[0]->{longitude}; | |||||||||||
| 106 | } | ||||||||||||
| 107 | |||||||||||||
| 108 | 0 | ▶ | sub postal { | ||||||||||
|
Subroutine
postal: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 109 | 0 | return $_[0]->{postal}; | |||||||||||
| 110 | } | ||||||||||||
| 111 | |||||||||||||
| 112 | 0 | ▶ | sub asn { | ||||||||||
|
Subroutine
asn: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 113 | 0 | return $_[0]->{asn}; | |||||||||||
| 114 | } | ||||||||||||
| 115 | |||||||||||||
| 116 | 0 | ▶ | sub company { | ||||||||||
|
Subroutine
company: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 117 | 0 | return $_[0]->{company}; | |||||||||||
| 118 | } | ||||||||||||
| 119 | |||||||||||||
| 120 | 0 | ▶ | sub carrier { | ||||||||||
|
Subroutine
carrier: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 121 | 0 | return $_[0]->{carrier}; | |||||||||||
| 122 | } | ||||||||||||
| 123 | |||||||||||||
| 124 | 0 | ▶ | sub meta { | ||||||||||
|
Subroutine
meta: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 125 | 0 | return $_[0]->{meta}; | |||||||||||
| 126 | } | ||||||||||||
| 127 | |||||||||||||
| 128 | 0 | ▶ | sub all { | ||||||||||
|
Subroutine
all: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 129 | 0 | return $_[0]; | |||||||||||
| 130 | } | ||||||||||||
| 131 | |||||||||||||
| 132 | #------------------------------------------------------------------------------- | ||||||||||||
| 133 | |||||||||||||
| 134 | 2 | 1; | |||||||||||
| 135 | __END__ | ||||||||||||