File Coverage

blib/lib/URI/magnet.pm
Criterion Covered Total %
statement 18 18 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod 1 1 100.0
total 28 28 100.0


line stmt bran cond sub pod time code
1             package URI::magnet;
2 2     2   61717 use warnings;
  2         4  
  2         63  
3 2     2   9 use strict;
  2         3  
  2         72  
4              
5 2     2   1581 use parent qw( URI::_generic URI::QueryParam );
  2         691  
  2         13  
6              
7             our $VERSION = 0.03;
8              
9             sub tr {
10 4     4 1 1728 my $self = shift;
11 4         18 my @tr = map { URI->new($_) } $self->query_param('tr');
  16         7310  
12              
13 4 100       1612 return wantarray ? @tr : $tr[0];
14             }
15              
16             {
17 2     2   34762 no strict 'refs'; ## no critic
  2         5  
  2         544  
18             foreach my $method ( qw( dn xl kt ) ) {
19             *{ __PACKAGE__ . "::$method" } =
20             sub {
21 6     6   2329 return shift->query_param( $method );
22             };
23             }
24              
25             foreach my $method ( qw( xt as xs mt ) ) {
26             *{ __PACKAGE__ . "::$method" } =
27             sub {
28 2     2   4332 return URI->new( shift->query_param($method) );
29             };
30             }
31             }
32              
33             *display_name = \&dn;
34             *exact_length = \&xl;
35             *keyword_topic = \&kt;
36             *exact_topic = \&xt;
37             *acceptable_source = \&as;
38             *exact_source = \&xs;
39             *manifest_topic = \&mt;
40             *address_tracker = \&tr;
41              
42              
43             42;
44             __END__