DRI/Data/Contact/PL.pm

filter: Statementstmt 63.6% 14 / 22 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 38.3% 18 / 47 CC 7 SCAR 35.8
CC
7
Cov
39%
validate
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 36.0
« DRI/Protocol/RRP/Core/Session.pm ↑ Summary DRI/Protocol/EPP/Extensions/AT/IOptions.pm »
1 ## Domain Registry Interface, Handling of contact data for .PL
2 ##
3 ## Copyright (c) 2006,2008,2013 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
4 ##
5 ## This file is part of Net::DRI
6 ##
7 ## Net::DRI is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2 of the License, or
10 ## (at your option) any later version.
11 ##
12 ## See the LICENSE file that comes with this distribution for more details.
13 #########################################################################################
14  
15 package Net::DRI::Data::Contact::PL;
16  
17 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 ▶use base qw/Net::DRI::Data::Contact/;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 __PACKAGE__->register_attributes(qw(individual consent_for_publishing));
24  
25 =pod
26  
27 =head1 NAME
28  
29 Net::DRI::Data::Contact::PL - Handle .PL contact data for Net::DRI
30  
31 =head1 DESCRIPTION
32  
33 This subclass of Net::DRI::Data::Contact adds accessors and validation for
34 .PL specific data.
35  
36 =head1 METHODS
37  
38 The following accessors/mutators can be called in chain, as they all return the object itself.
39  
40 =head2 individual()
41  
42 1 if the object represents a private person, 0 otherwise
43  
44 =head2 consent_for_publishing()
45  
46 1 if this person gave its assent for publishing personal details in WHOIS database, 0 otherwise.
47 This element has no meaning for a contact which does not represent a private person.
48  
49 =head1 SUPPORT
50  
51 For now, support questions should be sent to:
52  
53 E<lt>netdri@dotandco.comE<gt>
54  
55 Please also see the SUPPORT file in the distribution.
56  
57 =head1 SEE ALSO
58  
59 http://www.dotandco.com/services/software/Net-DRI/
60  
61 =head1 AUTHOR
62  
63 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
64  
65 =head1 COPYRIGHT
66  
67 Copyright (c) 2006,2008,2013 Patrick Mevzek <netdri@dotandco.com>.
68 All rights reserved.
69  
70 This program is free software; you can redistribute it and/or modify
71 it under the terms of the GNU General Public License as published by
72 the Free Software Foundation; either version 2 of the License, or
73 (at your option) any later version.
74  
75 See the LICENSE file that comes with this distribution for more details.
76  
77 =cut
78  
79 ####################################################################################################
80  
81 sub validate
82 {
83 0 ▶ my ($self,$change)=@_;
Subroutine validate: not called CC=7 SCAR=40.3
Pod undocumented
84 0 ▶ $change||=0;
Condition0%0/2
$change ||= 0
l!l
00
MC/DC0%0/1
$change ||= 0
$change
Truth table0%0/2
A
A= $change
Aresult
11
00
85 0 my @errs;
86  
87 0 $self->SUPER::validate($change); ## will trigger an Exception if problem
88  
89 0 ▶ push @errs,'individual' if (defined($self->individual()) && $self->individual()!~m/^(?:0|1)$/);
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->individual and not $self->individual =~ /^(?:0|1)$/ 0 0 0
Condition0%0/3
defined $self->individual and not $self->individual =~ /^(?:0|1)$/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $self->individual and not $self->individual =~ /^(?:0|1)$/
defined $self->individual not $self->individual =~ /^(?:0|1)$/
Truth table0%0/3
A and not(B)
A= defined $self->individualB= not $self->individual =~ /^(?:0|1)$/
ABresult
0X0
100
111
90 0 ▶ push @errs,'consent_for_publishing' if (defined($self->consent_for_publishing()) && $self->consent_for_publishing()!~m/^(?:0|1)$/);
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->consent_for_publishing and not $self->consent_for_publishing =~ /^(?:0|1)$/ 0 0 0
Condition0%0/3
defined $self->consent_for_publishing and not $self->consent_for_publishing =~ /^(?:0|1)$/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $self->consent_for_publishing and not $self->consent_for_publishing =~ /^(?:0|1)$/
defined $self->consent_for_publishing not $self->consent_for_publishing =~ /^(?:0|1)$/
Truth table0%0/3
A and not(B)
A= defined $self->consent_for_publishingB= not $self->consent_for_publishing =~ /^(?:0|1)$/
ABresult
0X0
100
111
91  
92 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid contact information: '.join('/',@errs)) if @errs;
Branch: 1 branch
BranchTrueFalseTotal
if @errs 0 0 0
93  
94 0 return 1; ## everything ok.
95 }
96  
97 ####################################################################################################
98 1 1;
« DRI/Protocol/RRP/Core/Session.pm ↑ Summary DRI/Protocol/EPP/Extensions/AT/IOptions.pm »