File Coverage

blib/lib/Map/Metro/Plugin/Hook/StreamStations.pm
Criterion Covered Total %
statement 14 19 73.6
branch n/a
condition n/a
subroutine 5 7 71.4
pod 0 1 0.0
total 19 27 70.3


line stmt bran cond sub pod time code
1 2     2   2013 use 5.10.0;
  2         6  
2 2     2   6 use strict;
  2         1  
  2         31  
3 2     2   5 use warnings;
  2         2  
  2         96  
4              
5             package Map::Metro::Plugin::Hook::StreamStations;
6              
7             # ABSTRACT: Prints stations as they are parsed
8             our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
9             our $VERSION = '0.2405';
10              
11 2     2   7 use Map::Metro::Elk;
  2         2  
  2         14  
12 2     2   2785 use Types::Standard qw/ArrayRef/;
  2         2  
  2         26  
13              
14             has station_names => (
15             is => 'rw',
16             isa => ArrayRef,
17             traits => ['Array'],
18             handles => {
19             add_station_name => 'push',
20             all_station_names => 'elements',
21             get_station_name => 'get',
22             },
23             );
24              
25             sub register {
26             before_add_station => sub {
27 0     0     my $self = shift;
28 0           my $station = shift;
29              
30 0           say $station->name;
31 0           $self->add_station_name($station->name);
32 0     0 0   };
33             }
34              
35             __PACKAGE__->meta->make_immutable;
36              
37             1;
38              
39             __END__
40              
41             =pod
42              
43             =encoding UTF-8
44              
45             =head1 NAME
46              
47             Map::Metro::Plugin::Hook::StreamStations - Prints stations as they are parsed
48              
49             =head1 VERSION
50              
51             Version 0.2405, released 2016-07-23.
52              
53             =head1 SOURCE
54              
55             L<https://github.com/Csson/p5-Map-Metro>
56              
57             =head1 HOMEPAGE
58              
59             L<https://metacpan.org/release/Map-Metro>
60              
61             =head1 AUTHOR
62              
63             Erik Carlsson <info@code301.com>
64              
65             =head1 COPYRIGHT AND LICENSE
66              
67             This software is copyright (c) 2016 by Erik Carlsson.
68              
69             This is free software; you can redistribute it and/or modify it under
70             the same terms as the Perl 5 programming language system itself.
71              
72             =cut