DRI/DRD/ZACR.pm

filter: Statementstmt 73.1% 30 / 41 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 10 / 14 Podpod 50.0% 4 / 8 totaltotal 67.1% 45 / 67 CC 3 SCAR 6.8
CC
3
Cov
69%
registrar_balance
6.0
transport_protocol_default
2.3
periods
2.0
CRAP 2.0
« DRI/Protocol/EPP/Extensions/Nominet/Session.pm ↑ Summary DRI/DRD/SIDN.pm »
1 ## Domain Registry Interface, ZACR (.CO.ZA) policies for Net::DRI
2 ##
3 ## Copyright (c) 2011,2012,2016 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::DRD::ZACR;
16  
17 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 2 ▶use base qw/Net::DRI::DRD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 2 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶use DateTime::Duration;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 2 __PACKAGE__->make_exception_for_unavailable_operations(qw/contact_check contact_transfer contact_transfer_start contact_transfer_stop contact_transfer_query contact_transfer_accept contact_transfer_refuse/);
27  
28 =pod
29  
30 =head1 NAME
31  
32 Net::DRI::DRD::ZACR - ZACR (.CO.ZA .ORG.ZA .NET.ZA .WEB.ZA) policies for Net::DRI
33  
34 =head1 DESCRIPTION
35  
36 Please see the README file for details.
37  
38 =head1 SUPPORT
39  
40 For now, support questions should be sent to:
41  
42 E<lt>netdri@dotandco.comE<gt>
43  
44 Please also see the SUPPORT file in the distribution.
45  
46 =head1 SEE ALSO
47  
48 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
49  
50 =head1 AUTHOR
51  
52 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
53  
54 =head1 COPYRIGHT
55  
56 Copyright (c) 2011,2012,2016 Patrick Mevzek <netdri@dotandco.com>.
57 All rights reserved.
58  
59 This program is free software; you can redistribute it and/or modify
60 it under the terms of the GNU General Public License as published by
61 the Free Software Foundation; either version 2 of the License, or
62 (at your option) any later version.
63  
64 See the LICENSE file that comes with this distribution for more details.
65  
66 =cut
67  
68 #####################################################################################
69  
70 sub new
71 {
72 1 ▶ my $class=shift;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
73 1 my $self=$class->SUPER::new(@_);
74 1 $self->{info}->{host_as_attr}=1;
75 1 $self->{info}->{contact_i18n}=1; ## LOC only ## Documentation does not say exactly what is allowed
76 1 bless($self,$class);
77 1 return $self;
78 }
79  
80 0 ▶sub periods { return map { DateTime::Duration->new(years => $_) } (1); } ## unknown precisely
Subroutine periods: not called CC=1 SCAR=6.9
Pod documented
81 1 ▶sub name { return 'ZACR'; }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
82 1 ▶sub tlds { return qw/co.za org.za net.za web.za/; }
Subroutine tlds: called CC=1 SCAR=0.0
Pod documented
83 0 ▶sub object_types { return (qw/domain contact/); }
Subroutine object_types: not called CC=1 SCAR=6.9
Pod documented
84 0 ▶sub profile_types { return qw/epp/; }
Subroutine profile_types: not called CC=1 SCAR=6.9
Pod undocumented
85  
86 sub transport_protocol_default
87 {
88 1 ▶ my ($self,$type)=@_;
Subroutine transport_protocol_default: called CC=2 SCAR=8.1
Pod undocumented
89  
90 1 ▶ return ('Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::COZA',{}) if $type eq 'epp';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "epp" 1 0 1
91 0 return;
92 }
93  
94 ######################################################################################
95  
96 sub registrar_balance
97 {
98 0 ▶ my ($self,$ndr)=@_;
Subroutine registrar_balance: not called CC=2 SCAR=17.9
Pod undocumented
99 0 my $clid=$self->info('client_id');
100 0 my $rc=$ndr->try_restore_from_cache('registrar',$clid,'balance');
101 0 ▶ if (! defined $rc) { $rc=$ndr->process('contact','info',[$ndr->local_object('contact')->srid($clid),{balance=>1}]); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $rc) 0 0 0
102 0 return $rc;
103 }
104  
105 #################################################################################################################
106 2 1;
« DRI/Protocol/EPP/Extensions/Nominet/Session.pm ↑ Summary DRI/DRD/SIDN.pm »