File Coverage

blib/lib/XML/Loy/HostMeta.pm
Criterion Covered Total %
statement 19 19 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1             package XML::Loy::HostMeta;
2 2     2   420536 use strict;
  2         4  
  2         61  
3 2     2   7 use warnings;
  2         3  
  2         135  
4              
5 2         9 use XML::Loy with => (
6             prefix => 'hm',
7             namespace => 'http://host-meta.net/xrd/1.0'
8 2     2   487 );
  2         5  
9              
10 2     2   11 use Carp qw/carp/;
  2         2  
  2         360  
11              
12             # No constructor
13             sub new {
14 1     1 1 464 carp 'Only use ' . __PACKAGE__ . ' as an extension to XRD';
15 1         387 return;
16             };
17              
18             # host information
19             sub host {
20 3     3 1 22 my $self = shift->root->at('*');
21              
22 3 100       43 unless ($_[0]) {
23 2 100       5 my $h = $self->at('Host') or return;
24 1         37 return $h->all_text;
25             };
26              
27             # Set hist information
28 1         4 return $self->set(Host => shift);
29             };
30              
31              
32             1;
33              
34              
35             __END__