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   1200 use strict;
  2         3  
  2         56  
3 2     2   10 use warnings;
  2         2  
  2         62  
4              
5 2         11 use XML::Loy with => (
6             prefix => 'hm',
7             namespace => 'http://host-meta.net/xrd/1.0'
8 2     2   499 );
  2         5  
9              
10 2     2   13 use Carp qw/carp/;
  2         4  
  2         346  
11              
12             # No constructor
13             sub new {
14 1     1 1 643 carp 'Only use ' . __PACKAGE__ . ' as an extension to XRD';
15 1         550 return;
16             };
17              
18             # host information
19             sub host {
20 3     3 1 11 my $self = shift->root->at('*');
21              
22 3 100       60 unless ($_[0]) {
23 2 100       6 my $h = $self->at('Host') or return;
24 1         29 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__