blib/lib/Map/Tube/Stuttgart.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 #
4 # Author: Gisbert W. Selke, TapirSoft Selke & Selke GbR.
5 #
6 # Copyright (C) 2025-2026 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 package Map::Tube::Stuttgart;
14 1 ▶use 5.14.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use version 0.77 ( );
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18
19 our $VERSION = version->declare('v0.1.3');
20
21 =encoding utf8
22
23 =head1 NAME
24
25 Map::Tube::Stuttgart - Interface to the Stuttgart tube map
26
27 =cut
28
29 1 ▶use File::Share ':all';
Subroutine BEGIN: called CC=1 SCAR=0.0
30 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
32
33 has xml => ( is => 'ro', default => sub { return dist_file('Map-Tube-Stuttgart', 'stuttgart-map.xml') } );
34
35 with 'Map::Tube';
36
37 =head1 SYNOPSIS
38
39 use Map::Tube::Stuttgart;
40 my $tube = Map::Tube::Stuttgart->new( );
41
42 my $route = $tube->get_shortest_route('Wilhelma', 'Bopser')->preferred( );
43
44 print "Route: $route\n";
45
46 =head1 DESCRIPTION
47
48 This module allows to find the shortest route between any two given tube
49 stations in Stuttgart. All interesting methods are provided by the role
50 L<Map::Tube>.
51
52 =head1 METHODS
53
54 =head2 CONSTRUCTOR
55
56 use Map::Tube::Stuttgart;
57 my $tube = Map::Tube::Stuttgart->new( );
58
59 The only argument, C<xml>, is optional; if specified, it should be a code ref
60 to a function that returns either the path the XML map file, or a string
61 containing this XML content. The default is the path to F<stuttgart-map.xml>
62 that is a part of this distribution. For further information see L<Map::Tube>.
63
64
65 =head2 xml( )
66
67 This read-only accessor returns whatever was specified as the XML source at
68 construction.
69
70
71 =head1 ERRORS
72
73 If something goes wrong, maybe because the map information file was corrupted,
74 the constructor will die.
75
76 =head1 BUGS
77
78 Please report any bugs or feature requests through the web interface at
79 L<https://github.com/gwselke/Map-Tube-Stuttgart/issues>. I will be
80 notified and then you'll automatically be notified of progress on your
81 bug when (and if) I make changes.
82
83 =head1 AUTHOR
84
85 Gisbert W. Selke, TapirSoft Selke & Selke GbR.
86
87 =head1 COPYRIGHT AND LICENCE
88
89 The data for the XML file were taken from L<www.vvs.de>.
90 The module itself is free software; you may redistribute and/or modify it under
91 the same terms as Perl itself.
92
93 =head1 SEE ALSO
94
95 L<Map::Tube>, L<Map::Tube::GraphViz>.
96
97 =cut
98
99 1;
↑ Summary