File Coverage

blib/lib/Net/DRI/DRD/ZACR.pm
Criterion Covered Total %
statement 28 39 71.7
branch 1 4 25.0
condition n/a
subroutine 10 14 71.4
pod 4 8 50.0
total 43 65 66.1


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, ZACR (.CO.ZA) policies for Net::DRI
2             ##
3             ## Copyright (c) 2011,2012,2016 Patrick Mevzek . 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     2   1001 use strict;
  2         2  
  2         45  
18 2     2   5 use warnings;
  2         2  
  2         38  
19              
20 2     2   6 use base qw/Net::DRI::DRD/;
  2         3  
  2         546  
21              
22 2     2   9 use Net::DRI::Util;
  2         2  
  2         29  
23 2     2   6 use Net::DRI::Exception;
  2         2  
  2         26  
24 2     2   5 use DateTime::Duration;
  2         3  
  2         437  
25              
26             __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             Enetdri@dotandco.comE
43              
44             Please also see the SUPPORT file in the distribution.
45              
46             =head1 SEE ALSO
47              
48             Ehttp://www.dotandco.com/services/software/Net-DRI/E
49              
50             =head1 AUTHOR
51              
52             Patrick Mevzek, Enetdri@dotandco.comE
53              
54             =head1 COPYRIGHT
55              
56             Copyright (c) 2011,2012,2016 Patrick Mevzek .
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     1 0 2 my $class=shift;
73 1         5 my $self=$class->SUPER::new(@_);
74 1         4 $self->{info}->{host_as_attr}=1;
75 1         2 $self->{info}->{contact_i18n}=1; ## LOC only ## Documentation does not say exactly what is allowed
76 1         1 bless($self,$class);
77 1         3 return $self;
78             }
79              
80 0     0 1 0 sub periods { return map { DateTime::Duration->new(years => $_) } (1); } ## unknown precisely
  0         0  
81 1     1 1 6 sub name { return 'ZACR'; }
82 1     1 1 3 sub tlds { return qw/co.za org.za net.za web.za/; }
83 0     0 1 0 sub object_types { return (qw/domain contact/); }
84 0     0 0 0 sub profile_types { return qw/epp/; }
85              
86             sub transport_protocol_default
87             {
88 1     1 0 1 my ($self,$type)=@_;
89              
90 1 50       4 return ('Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::COZA',{}) if $type eq 'epp';
91 0           return;
92             }
93              
94             ######################################################################################
95              
96             sub registrar_balance
97             {
98 0     0 0   my ($self,$ndr)=@_;
99 0           my $clid=$self->info('client_id');
100 0           my $rc=$ndr->try_restore_from_cache('registrar',$clid,'balance');
101 0 0         if (! defined $rc) { $rc=$ndr->process('contact','info',[$ndr->local_object('contact')->srid($clid),{balance=>1}]); }
  0            
102 0           return $rc;
103             }
104              
105             #################################################################################################################
106             1;