EPP/Frame/Command/Transfer/Domain.pm

filter: Statementstmt 31.2% 10 / 32 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 25.0% 1 / 4 totaltotal 32.5% 14 / 43 CC 1 SCAR 4.5
CC
1
Cov
31%
new
2.0
setDomain
2.0
setPeriod
2.0
CRAP 1.6
« EPP/Frame/Command/Login.pm ↑ Summary EPP/Frame/Command/Renew/Domain.pm »
1 package Net::EPP::Frame::Command::Transfer::Domain;
2 1 ▶use base qw(Net::EPP::Frame::Command::Transfer);
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Net::EPP::Frame::ObjectSpec;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =pod
7  
8 =head1 NAME
9  
10 Net::EPP::Frame::Command::Transfer::Domain - an instance of L<Net::EPP::Frame::Command::Transfer>
11 for domain objects.
12  
13 =head1 SYNOPSIS
14  
15 use Net::EPP::Frame::Command::Transfer::Domain;
16 use strict;
17  
18 my $info = Net::EPP::Frame::Command::Transfer::Domain->new;
19 $info->setOp('query');
20 $info->setDomain('example.tld');
21  
22 print $info->toString(1);
23  
24 This results in an XML document like this:
25  
26 <?xml version="1.0" encoding="UTF-8"?>
27 <epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
28 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
29 xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
30 epp-1.0.xsd">
31 <command>
32 <transfer op="query">
33 <domain:transfer
34 xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
35 xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0
36 domain-1.0.xsd">
37 <domain:name>example.tldE<lt>/domain:name>
38 </domain:transfer>
39 </transfer>
40 <clTRID>0cf1b8f7e14547d26f03b7641660c641d9e79f45</clTRIDE<gt>
41 </command>
42 </epp>
43  
44 =head1 OBJECT HIERARCHY
45  
46 L<XML::LibXML::Node>
47 +----L<XML::LibXML::Document>
48 +----L<Net::EPP::Frame>
49 +----L<Net::EPP::Frame::Command>
50 +----L<Net::EPP::Frame::Command::Transfer>
51 +----L<Net::EPP::Frame::Command::Transfer::Domain>
52  
53 =cut
54  
55 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
56 0 my $package = shift;
57 0 my $self = bless($package->SUPER::new('transfer'), $package);
58  
59 0 my $domain = $self->addObject(Net::EPP::Frame::ObjectSpec->spec('domain'));
60  
61 0 return $self;
62 }
63  
64 =pod
65  
66 =head1 METHODS
67  
68 $frame->setDomain('example.tld');
69  
70 This method specifies the domain name for the transfer.
71  
72 =cut
73  
74 0 ▶sub setDomain {
Subroutine setDomain: not called CC=1 SCAR=6.9
Pod undocumented
75 0 my ($self, $domain) = @_;
76  
77 0 my $name = $self->createElement('domain:name');
78 0 $name->appendText($domain);
79  
80 0 $self->getNode('transfer')->getChildNodes->shift->appendChild($name);
81  
82 0 return 1;
83 }
84  
85 =pod
86  
87 $frame->period($years);
88  
89 This sets the optional renewal period for the transfer.
90  
91 =cut
92  
93 0 ▶sub setPeriod {
Subroutine setPeriod: not called CC=1 SCAR=6.9
Pod undocumented
94 0 my ($self, $years) = @_;
95  
96 0 my $period = $self->createElement('domain:period');
97 0 $period->setAttribute('unit', 'y');
98 0 $period->appendText($years);
99  
100 0 $self->getNode('transfer')->getChildNodes->shift->appendChild($period);
101  
102 0 return 1;
103 }
104  
105 =pod
106  
107 $frame->setAuthInfo($pw);
108  
109 This sets the authInfo code for the transfer.
110  
111 =cut
112  
113 0 ▶sub setAuthInfo {
Subroutine setAuthInfo: not called CC=1 SCAR=6.9
Pod undocumented
114 0 my ($self, $code) = @_;
115  
116 0 my $pw = $self->createElement('domain:pw');
117 0 $pw->appendText($code);
118  
119 0 my $authInfo = $self->createElement('domain:authInfo');
120 0 $authInfo->appendChild($pw);
121  
122 0 $self->getNode('transfer')->getChildNodes->shift->appendChild($authInfo);
123  
124 0 return 1;
125 }
126  
127 1 1;
« EPP/Frame/Command/Login.pm ↑ Summary EPP/Frame/Command/Renew/Domain.pm »