File Coverage

blib/lib/Footprintless/Resource/Url.pm
Criterion Covered Total %
statement 15 15 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 23 23 100.0


line stmt bran cond sub pod time code
1 4     4   23 use strict;
  4         6  
  4         96  
2 4     4   15 use warnings;
  4         11  
  4         168  
3              
4             package Footprintless::Resource::Url;
5             $Footprintless::Resource::Url::VERSION = '1.29';
6             # ABSTRACT: A resource described by URL
7             # PODNAME: Footprintless::Resource::Url
8              
9 4     4   19 use parent qw(Footprintless::Resource);
  4         7  
  4         31  
10              
11             sub get_uri {
12 25     25 1 131 return $_[0]->{uri};
13             }
14              
15             sub _init {
16 22     22   49 my ( $self, $url ) = @_;
17              
18 22         166 $self->{uri} = URI->new($url);
19             $self->{uri} = $self->{uri}->abs('file://')
20 22 100       20484 unless ( $self->{uri}->has_recognized_scheme() );
21              
22 22         7849 $self->Footprintless::Resource::_init( $self->{uri}->as_string() );
23              
24 22         89 return $self;
25             }
26              
27             1;
28              
29             __END__