EPP/Frame/Command/Check/Host.pm

filter: Statementstmt 52.6% 10 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 50.0% 1 / 2 totaltotal 53.8% 14 / 26 CC 1 SCAR 3.4
CC
1
Cov
53%
new
2.0
addHost
2.0
BEGIN
1.0
CRAP 1.4
« EPP/Frame/Command/Check/Domain.pm ↑ Summary EPP/Frame/Command/Delete/Contact.pm »
1 package Net::EPP::Frame::Command::Check::Host;
2 1 ▶use base qw(Net::EPP::Frame::Command::Check);
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::Check::Host - an instance of L<Net::EPP::Frame::Command::Check>
11 for host objects.
12  
13 =head1 SYNOPSIS
14  
15 use Net::EPP::Frame::Command::Check::Host;
16 use strict;
17  
18 my $check = Net::EPP::Frame::Command::Check::Host->new;
19 $check->addHost('example-1.tld');
20 $check->addHost('example-2.tld');
21 $check->addHost('example-2.tld');
22  
23 print $check->toString(1);
24  
25 This results in an XML document like this:
26  
27 <?xml version="1.0" encoding="UTF-8"?>
28 <epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
29 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
30 xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
31 epp-1.0.xsd">
32 <command>
33 <check>
34 <host:check
35 xmlns:host="urn:ietf:params:xml:ns:host-1.0"
36 xsi:schemaLocation="urn:ietf:params:xml:ns:host-1.0
37 host-1.0.xsd">
38 <host:name>ns0.example-1.tldE<lt>/host:name>
39 <host:name>ns1.example-2.tldE<lt>/host:name>
40 <host:name>ns2.example-3.tldE<lt>/host:name>
41 </host:check>
42 </check>
43 <clTRID>0cf1b8f7e14547d26f03b7641660c641d9e79f45</clTRIDE<gt>
44 </command>
45 </epp>
46  
47 =head1 OBJECT HIERARCHY
48  
49 L<XML::LibXML::Node>
50 +----L<XML::LibXML::Document>
51 +----L<Net::EPP::Frame>
52 +----L<Net::EPP::Frame::Command>
53 +----L<Net::EPP::Frame::Command::Check>
54 +----L<Net::EPP::Frame::Command::Check::Host>
55  
56 =cut
57  
58 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
59 0 my $package = shift;
60 0 my $self = bless($package->SUPER::new('check'), $package);
61  
62 0 $self->addObject(Net::EPP::Frame::ObjectSpec->spec('host'));
63  
64 0 return $self;
65 }
66  
67 =pod
68  
69 =head1 METHODS
70  
71 $frame->addHost($host_name);
72  
73 This adds a hostname to the list of hosts to be checked.
74  
75 =cut
76  
77 0 ▶sub addHost {
Subroutine addHost: not called CC=1 SCAR=6.9
Pod undocumented
78 0 my ($self, $host) = @_;
79  
80 0 my $name = $self->createElement('host:name');
81 0 $name->appendText($host);
82  
83 0 $self->getNode('check')->getChildNodes->shift->appendChild($name);
84  
85 0 return 1;
86 }
87  
88 1 1;
« EPP/Frame/Command/Check/Domain.pm ↑ Summary EPP/Frame/Command/Delete/Contact.pm »