File Coverage

blib/lib/Map/Tube/Lyon.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::Lyon;
15 1     1   14822 use strict;
  1         2  
  1         42  
16 1     1   4 use warnings;
  1         2  
  1         39  
17            
18             our $VERSION = '0.04';
19            
20             =encoding utf8
21            
22             =head1 NAME
23            
24             Map::Tube::Lyon - Interface to the Lyon metro map
25            
26             =cut
27            
28 1     1   428 use File::Share ':all';
  1         5863  
  1         174  
29 1     1   558 use Moo;
  1         10782  
  1         5  
30 1     1   1617 use namespace::clean;
  1         9205  
  1         6  
31            
32             has xml => ( is => 'ro', default => sub { return dist_file( 'Map-Tube-Lyon', 'lyon-map.xml' ) } );
33            
34             with 'Map::Tube';
35            
36             =head1 SYNOPSIS
37            
38             use Map::Tube::Lyon;
39             my $tube = Map::Tube::Lyon->new();
40            
41             my $route = $tube->get_shortest_route('Foch', 'Gorge de Loup');
42            
43             print "Route: $route\n";
44            
45             =head1 DESCRIPTION
46            
47             This module allows to find the shortest route between any two given métro
48             stations in Lyon. All interesting methods are provided by the role L.
49            
50             =head1 METHODS
51            
52             =head2 CONSTRUCTOR
53            
54             use Map::Tube::Lyon;
55             my $tube = Map::Tube::Lyon->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 the French-language Wikipedia,
72             entry "Liste des stations du métro de Lyon". It is CC BY-SA. The module
73             itself is free software; you may redistribute and/or modify it under the
74             same terms as Perl itself.
75            
76             =head1 SEE ALSO
77            
78             L, L.
79            
80             =cut
81            
82             1;