File Coverage

blib/lib/Net/DRI/Protocol/EPP/Extensions/Afilias/MaintainerUrl.pm
Criterion Covered Total %
statement 12 24 50.0
branch 0 8 0.0
condition 0 3 0.0
subroutine 4 7 57.1
pod 0 3 0.0
total 16 45 35.5


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, Afilias maintainerUrl EPP extension
2             ##
3             ## Copyright (c) 2010 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::Protocol::EPP::Extensions::Afilias::MaintainerUrl;
16              
17 1     1   4 use strict;
  1         4  
  1         29  
18 1     1   4 use warnings;
  1         1  
  1         16  
19              
20 1     1   3 use Net::DRI::Util;
  1         1  
  1         13  
21 1     1   3 use Net::DRI::Exception;
  1         2  
  1         201  
22              
23             ####################################################################################################
24              
25             sub create
26             {
27 0     0 0   my ($ns,$rd)=@_;
28 0 0         return unless Net::DRI::Util::has_key($rd,'maintainer_url');
29 0           return [$ns.':maintainerUrl',$rd->{maintainer_url}];
30             }
31              
32             sub update
33             {
34 0     0 0   my ($ns,$todo)=@_;
35              
36 0 0         Net::DRI::Exception->die(0,'protocol/EPP',11,'Only maintainer_url set available for domain') if (grep { ! /^(?:set)$/ } $todo->types('maintainer_url'));
  0            
37 0 0         return unless $todo->set('maintainer_url');
38 0           return [$ns.':maintainerUrl',$todo->set('maintainer_url')];
39             }
40              
41             sub info_parse
42             {
43 0     0 0   my ($ns,$infdata)=@_;
44 0           my $c=$infdata->getChildrenByTagNameNS($ns,'maintainerUrl');
45 0 0 0       return unless (defined $c && $c->size()==1);
46 0           return $c->get_node(1)->textContent();
47             }
48              
49             ####################################################################################################
50             1;
51              
52             __END__