File Coverage

blib/lib/Net/DRI/Protocol/RRP/Core/Status.pm
Criterion Covered Total %
statement 24 29 82.7
branch 3 6 50.0
condition n/a
subroutine 8 13 61.5
pod 8 9 88.8
total 43 57 75.4


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, RRP Status
2             ##
3             ## Copyright (c) 2005,2011 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::RRP::Core::Status;
16              
17 2     2   10 use base qw!Net::DRI::Data::StatusList!;
  2         4  
  2         167  
18              
19 2     2   10 use strict;
  2         3  
  2         44  
20 2     2   7 use warnings;
  2         3  
  2         49  
21              
22 2     2   9 use Net::DRI::Exception;
  2         4  
  2         498  
23              
24             =pod
25              
26             =head1 NAME
27              
28             Net::DRI::Protocol::RRP::Core::Status - RRP Status for Net::DRI
29              
30             =head1 DESCRIPTION
31              
32             Please see the README file for details.
33              
34             =head1 SUPPORT
35              
36             For now, support questions should be sent to:
37              
38             Enetdri@dotandco.comE
39              
40             Please also see the SUPPORT file in the distribution.
41              
42             =head1 SEE ALSO
43              
44             Ehttp://www.dotandco.com/services/software/Net-DRI/E
45              
46             =head1 AUTHOR
47              
48             Patrick Mevzek, Enetdri@dotandco.comE
49              
50             =head1 COPYRIGHT
51              
52             Copyright (c) 2005,2011 Patrick Mevzek .
53             All rights reserved.
54              
55             This program is free software; you can redistribute it and/or modify
56             it under the terms of the GNU General Public License as published by
57             the Free Software Foundation; either version 2 of the License, or
58             (at your option) any later version.
59              
60             See the LICENSE file that comes with this distribution for more details.
61              
62             =cut
63              
64             #######################################################################################
65              
66             sub new
67             {
68 2     2 0 4 my ($class,$msg)=@_;
69 2         19 my $self=$class->SUPER::new('rrp','2.0');
70              
71 2         12 my %s=('delete' => 'REGISTRAR-LOCK',
72             'update' => 'REGISTRAR-LOCK',
73             'transfer' => 'REGISTRAR-LOCK',
74             'publish' => 'REGISTRAR-HOLD',
75             );
76 2         11 $self->_register_pno(\%s);
77              
78 2 50       6 return $self unless defined $msg;
79 2 50       6 Net::DRI::Exception::err_invalid_parameters() unless ref $msg eq 'Net::DRI::Protocol::RRP::Message';
80              
81 2         7 my @s=$msg->entities('status');
82 2 50       15 $self->add(@s) if @s;
83 2         8 return $self;
84             }
85              
86 2     2 1 58 sub is_active { return shift->has_any('ACTIVE'); }
87 1     1 1 6 sub is_published { return ! shift->has_any('REGISTRY-HOLD','REGISTRAR-HOLD'); }
88 0     0 1 0 sub is_pending { return shift->has_any('REGISTRY-DELETE-NOTIFY','PENDINGRESTORE','PENDINGDELETE','PENDINGTRANSFER'); }
89 0     0 1 0 sub is_linked { return shift->has_any('REGISTRY-DELETE-NOTIFY'); }
90 1     1 1 7 sub can_update { return ! shift->has_any('REGISTRY-LOCK','REGISTRY-HOLD','REGISTRAR-HOLD','REGISTRAR-LOCK','REGISTRY-DELETE-NOTIFY','PENDINGRESTORE','PENDINGDELETE','PENDINGTRANSFER'); }
91 0     0 1   sub can_transfer { return shift->can_update(); }
92 0     0 1   sub can_delete { return shift->can_update(); }
93 0     0 1   sub can_renew { return ! shift->has_any('REGISTRY-DELETE-NOTIFY','REDEMPTIONPERIOD','PENDINGRESTORE','PENDINGDELETE','PENDINGTRANSFER'); }
94              
95             #######################################################################################
96             1;