File Coverage

blib/lib/SRS/EPP/Response/Info.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1              
2             package SRS::EPP::Response::Info;
3 1     1   1290 use Moose;
  0            
  0            
4             extends 'SRS::EPP::Response';
5             use Data::Dumper;
6              
7             has "+message" =>
8             lazy => 1,
9             default => \&make_response,
10             ;
11              
12             has 'payload' =>
13             is => 'rw',
14             isa => 'XML::EPP::Plugin', # XML::EPP::Plugin
15             required => 1,
16             ;
17              
18             sub make_response {
19             my $self = shift;
20              
21             my $server_id = $self->server_id;
22             my $client_id = $self->client_id;
23              
24             my $tx_id;
25             if ( $server_id ) {
26             $tx_id = XML::EPP::TrID->new(
27             server_id => $server_id,
28             ($client_id ? (client_id => $client_id) : () ),
29             );
30             }
31              
32             my $msg = $self->extra;
33             my $result = XML::EPP::Result->new(
34             ($msg ? (msg => $msg) : ()),
35             # msg => '',
36             code => $self->code,
37             );
38              
39             my $xml_epp = XML::EPP->new(
40             message => XML::EPP::Response->new(
41             result => [$result],
42             response => XML::EPP::SubResponse->new(
43             payload => $self->payload,
44             ),
45             ($tx_id ? (tx_id => $tx_id) : () ),
46             ),
47             );
48             return $xml_epp;
49             }
50              
51             1;