blib/lib/Map/Tube/Lyon.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 27 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 # -*- perl -*-
2 #
3 # Author: Gisbert W. Selke, TapirSoft Selke & Selke GbR.
4 #
5 # Copyright (C) 2015, 2025 Gisbert W. Selke. All rights reserved.
6 # This package is free software; you can redistribute it and/or
7 # modify it under the same terms as Perl itself.
8 #
9 # Mail: gws@cpan.org
10 #
11
12 package Map::Tube::Lyon;
13 1 ▶use 5.14.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use version 0.77 ( );
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
17
18 our $VERSION = version->declare('v0.62.4');
19
20 =encoding utf8
21
22 =head1 NAME
23
24 Map::Tube::Lyon - Interface to the Lyon metro, funicular and tramway map
25
26 =cut
27
28 1 ▶use File::Share ':all';
Subroutine BEGIN: called CC=1 SCAR=0.0
29 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
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
48 stations in Lyon. Metro, funiculars and tramways are covered.
49 All interesting methods are provided by the role L<Map::Tube>.
50
51 =head1 METHODS
52
53 =head2 CONSTRUCTOR
54
55 use Map::Tube::Lyon;
56 my $tube = Map::Tube::Lyon->new();
57
58 The only argument, C<xml>, is optional; if specified, it should be a code ref
59 to a function that returns either the path the XML map file, or a string
60 containing this XML content. The default is the path to F<lyon-map.xml>
61 that is a part of this distribution. For further information see L<Map::Tube>.
62
63 =head2 xml()
64
65 This read-only accessor returns whatever was specified as the XML source at
66 construction.
67
68 =head1 ERRORS
69
70 If something goes wrong, maybe because the map information file was corrupted,
71 the constructor will die.
72
73 =head1 AUTHOR
74
75 Gisbert W. Selke, TapirSoft Selke & Selke GbR.
76
77 =head1 COPYRIGHT AND LICENCE
78
79 The data for the XML file were taken from the French-language Wikipedia,
80 entry "Liste des stations du métro de Lyon". It is CC BY-SA. The module
81 itself is free software; you may redistribute and/or modify it under the
82 same terms as Perl itself.
83
84 =head1 SEE ALSO
85
86 L<Map::Tube>, L<Map::Tube::GraphViz>.
87
88 =cut
89
90 1;
↑ Summary