File Coverage

blib/lib/Map/Tube/Glasgow.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             # -*- perl -*-
2            
3             #
4             # Author: Gisbert W. Selke, TapirSoft Selke & Selke GbR.
5             #
6             # Copyright (C) 2015 Gisbert W. Selke. All rights reserved.
7             # This package is free software; you can redistribute it and/or
8             # modify it under the same terms as Perl itself.
9             #
10             # Mail: gws@cpan.org
11             #
12            
13            
14             package Map::Tube::Glasgow;
15 1     1   27927 use strict;
  1         3  
  1         74  
16 1     1   8 use warnings;
  1         2  
  1         85  
17            
18             our $VERSION = '0.05';
19            
20             =encoding utf8
21            
22             =head1 NAME
23            
24             Map::Tube::Glasgow - Interface to the Glasgow tube map
25            
26             =cut
27            
28 1     1   706 use File::Share ':all';
  1         11227  
  1         249  
29 1     1   884 use Moo;
  1         19723  
  1         7  
30 1     1   3051 use namespace::clean;
  1         16344  
  1         10  
31            
32             has xml => ( is => 'ro', default => sub { return dist_file('Map-Tube-Glasgow', 'glasgow-map.xml') } );
33            
34             with 'Map::Tube';
35            
36             =head1 SYNOPSIS
37            
38             use Map::Tube::Glasgow;
39             my $tube = Map::Tube::Glasgow->new();
40            
41             my $route = $tube->get_shortest_route('Cowcaddens', 'Bridge Street');
42            
43             print "Route: $route\n";
44            
45             =head1 DESCRIPTION
46            
47             This module allows to find the shortest route between any two given tube
48             stations in Glasgow. All interesting methods are provided by the role L.
49            
50             =head1 METHODS
51            
52             =head2 CONSTRUCTOR
53            
54             use Map::Tube::Glasgow;
55             my $tube = Map::Tube::Glasgow->new;
56            
57             This will read the tube information from the shared file F,
58             which is part of the distribution.
59            
60             =head1 ERRORS
61            
62             If something goes wrong, maybe because the map information file was corrupted,
63             the constructor will die.
64            
65             =head1 AUTHOR
66            
67             Gisbert W. Selke, TapirSoft Selke & Selke GbR.
68            
69             =head1 COPYRIGHT AND LICENCE
70            
71             The data for the XML file were taken from an image in the English-language
72             Wikipedia in the entry "Glasgow Subway". It is CC BY-SA 2.0 David Arthur, 2006.
73             The module itself is free software; you may redistribute and/or modify
74             it under the same terms as Perl itself.
75            
76             =head1 SEE ALSO
77            
78             L, L.
79            
80             =cut
81            
82             1;