File Coverage

blib/lib/Map/Tube/KoelnBonn.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             # Author: Gisbert W. Selke, TapirSoft Selke & Selke GbR.
4             #
5             # Copyright (C) 2015 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             package Map::Tube::KoelnBonn;
12 1     1   20700 use strict;
  1         3  
  1         50  
13 1     1   7 use warnings;
  1         2  
  1         78  
14            
15             our $VERSION = '0.07';
16            
17             =encoding utf8
18            
19             =head1 NAME
20            
21             Map::Tube::KoelnBonn - Interface to the Koeln-Bonn U-Bahn map
22            
23             =cut
24            
25 1     1   599 use File::Share ':all';
  1         8009  
  1         180  
26 1     1   532 use Moo;
  1         12647  
  1         6  
27 1     1   1660 use namespace::clean;
  1         11921  
  1         8  
28            
29             has xml => ( is => 'ro', default => sub { return dist_file('Map-Tube-KoelnBonn', 'koelnbonn-map.xml') } );
30            
31             with 'Map::Tube';
32            
33             =head1 SYNOPSIS
34            
35             use Map::Tube::KoelnBonn;
36             my $tube = Map::Tube::KoelnBonn->new();
37            
38             my $route = $tube->get_shortest_route('Wurzerstr.', 'Plittersdorf');
39            
40             print "Route: $route\n";
41            
42             =head1 DESCRIPTION
43            
44             This module allows to find the shortest route between any two given tube
45             stations in Köln and Bonn. In fact, underground, tramway, and S-Bahn lines
46             are covered for the wider Köln-Bonn area (VRS).
47             All interesting methods are provided by the role L.
48            
49             =head1 METHODS
50            
51             =head2 CONSTRUCTOR
52            
53             use Map::Tube::KoelnBonn;
54             my $tube = Map::Tube::KoelnBonn->new();
55            
56             The only argument, C, is optional; if specified, it should be a code ref
57             to a function that returns either the path the XML map file, or a string
58             containing this XML content. The default is the path to F
59             that is a part of this distribution. For further information see L.
60            
61             =head2 xml()
62            
63             This read-only accessor returns whatever was specified as the XML source at
64             construction.
65            
66             =head1 ERRORS
67            
68             If something goes wrong, maybe because the map information file was corrupted,
69             the constructor will die.
70            
71             =head1 AUTHOR
72            
73             Gisbert W. Selke, TapirSoft Selke & Selke GbR
74            
75             =head1 COPYRIGHT AND LICENCE
76            
77             The data for the XML file were mainly taken from the appropriate OpenStreetMap
78             maps. They are CC BY-SA 2.0, with some modifications made based on personal
79             knowledge, in particular in order to disambiguate station names. The module
80             itself is free software; you may redistribute and/or modify it under the
81             same terms as Perl itself.
82            
83             =head1 SEE ALSO
84            
85             L, L.
86            
87             =cut
88            
89             1;