| 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
| |||||||||||
| 23 | 2 | ▶ | my $h = $self->at('Host') or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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__ | ||||||||||