File Coverage

blib/lib/Net/EPP/Frame/Command/Delete/Host.pm
Criterion Covered Total %
statement 9 18 50.0
branch n/a
condition n/a
subroutine 3 5 60.0
pod 0 2 0.0
total 12 25 48.0


line stmt bran cond sub pod time code
1             # Copyright (c) 2016 CentralNic Ltd. All rights reserved. This program is
2             # free software; you can redistribute it and/or modify it under the same
3             # terms as Perl itself.
4             #
5             # $Id: Host.pm,v 1.3 2011/01/23 12:26:24 gavin Exp $
6             package Net::EPP::Frame::Command::Delete::Host;
7 1     1   3 use base qw(Net::EPP::Frame::Command::Delete);
  1         1  
  1         57  
8 1     1   4 use Net::EPP::Frame::ObjectSpec;
  1         1  
  1         12  
9 1     1   2 use strict;
  1         1  
  1         100  
10              
11             =pod
12              
13             =head1 NAME
14              
15             Net::EPP::Frame::Command::Delete::Host - an instance of L
16             for host objects.
17              
18             =head1 SYNOPSIS
19              
20             use Net::EPP::Frame::Command::Delete::Host;
21             use strict;
22              
23             my $delete = Net::EPP::Frame::Command::Delete::Host->new;
24             $delete->setHost('example.tld');
25              
26             print $delete->toString(1);
27              
28             This results in an XML document like this:
29              
30            
31            
32             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33             xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
34             epp-1.0.xsd">
35            
36            
37            
38             xmlns:host="urn:ietf:params:xml:ns:host-1.0"
39             xsi:schemaLocation="urn:ietf:params:xml:ns:host-1.0
40             host-1.0.xsd">
41             ns0.example.tldE/host:name>
42            
43            
44             0cf1b8f7e14547d26f03b7641660c641d9e79f45
45            
46            
47              
48             =head1 OBJECT HIERARCHY
49              
50             L
51             +----L
52             +----L
53             +----L
54             +----L
55             +----L
56              
57             =cut
58              
59             sub new {
60 0     0 0   my $package = shift;
61 0           my $self = bless($package->SUPER::new('delete'), $package);
62              
63 0           my $host = $self->addObject(Net::EPP::Frame::ObjectSpec->spec('host'));
64              
65 0           return $self;
66             }
67              
68             =pod
69              
70             =head1 METHODS
71              
72             $frame->setHost($host_name);
73              
74             This specifies the host object to be deleted.
75              
76             =cut
77              
78             sub setHost {
79 0     0 0   my ($self, $host) = @_;
80              
81 0           my $name = $self->createElement('host:name');
82 0           $name->appendText($host);
83              
84 0           $self->getNode('delete')->getChildNodes->shift->appendChild($name);
85              
86 0           return 1;
87             }
88              
89             =pod
90              
91             =head1 AUTHOR
92              
93             CentralNic Ltd (http://www.centralnic.com/).
94              
95             =head1 COPYRIGHT
96              
97             This module is (c) 2016 CentralNic Ltd. This module is free software; you can
98             redistribute it and/or modify it under the same terms as Perl itself.
99              
100             =head1 SEE ALSO
101              
102             =over
103              
104             =item * L
105              
106             =back
107              
108             =cut
109              
110             1;