blib/lib/XML/Loy/HostMeta.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 100% 32 / 32 CC 3 SCAR 5.6
CC
3
Cov
100%
host
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« lib/XML/Loy/OStatus.pm ↑ Summary blib/lib/Test/XML/Loy.pm »
1 package XML::Loy::HostMeta;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 use XML::Loy with => (
6 prefix => 'hm',
7 namespace => 'http://host-meta.net/xrd/1.0'
8 1 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Carp qw/carp/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 # No constructor
13 sub new {
14 1 ▶ carp 'Only use ' . __PACKAGE__ . ' as an extension to XRD';
Subroutine new: called CC=1 SCAR=0.0
Pod documented
15 1 return;
16 };
17  
18 # host information
19 sub host {
20 3 ▶ my $self = shift->root->at('*');
Subroutine host: called CC=3 SCAR=11.0
Pod documented
21  
22 3 ▶ unless ($_[0]) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($_[0]) 2 1 3
23 2 ▶ my $h = $self->at('Host') or return;
Branch: 1 branch
BranchTrueFalseTotal
my $h = $self->at("Host") or return 1 1 2
24 1 return $h->all_text;
25 };
26  
27 # Set hist information
28 1 return $self->set(Host => shift);
29 };
30  
31  
32 1 1;
33  
34  
35 __END__
« lib/XML/Loy/OStatus.pm ↑ Summary blib/lib/Test/XML/Loy.pm »