line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Value::Object::Domain; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
49729
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
132
|
|
4
|
5
|
|
|
5
|
|
24
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
98
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
1133
|
use Value::Object::ValidationUtils; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
233
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.15'; |
9
|
|
|
|
|
|
|
|
10
|
5
|
|
|
5
|
|
3569
|
use parent 'Value::Object'; |
|
5
|
|
|
|
|
1478
|
|
|
5
|
|
|
|
|
28
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _why_invalid |
13
|
|
|
|
|
|
|
{ |
14
|
15
|
|
|
15
|
|
27
|
my ($self, $value) = @_; |
15
|
15
|
|
|
|
|
48
|
my ($why, $long, $data) = Value::Object::ValidationUtils::why_invalid_domain_name( $value ); |
16
|
15
|
100
|
|
|
|
46
|
return ( ref($self) . ": $why", $long, $data ) if defined $why; |
17
|
13
|
|
|
|
|
31
|
return; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new_canonical |
21
|
|
|
|
|
|
|
{ |
22
|
2
|
|
|
2
|
1
|
696
|
my ($class, $value) = @_; |
23
|
2
|
|
|
|
|
6
|
$value =~ tr/A-Z/a-z/; |
24
|
2
|
|
|
|
|
7
|
return $class->new( $value ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub make_subdomain |
28
|
|
|
|
|
|
|
{ |
29
|
5
|
|
|
5
|
1
|
1348
|
my ($self, $label) = @_; |
30
|
5
|
100
|
|
|
|
23
|
die ref($self) . ': undefined label' unless defined $label; |
31
|
4
|
100
|
|
|
|
6
|
die ref($self) .': Not a DomainLabel' unless eval { $label->isa( 'Value::Object::DomainLabel' ); }; |
|
4
|
|
|
|
|
46
|
|
32
|
2
|
|
|
|
|
7
|
return __PACKAGE__->new( $label->value . '.' . $self->value ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |