| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
2
|
|
|
2
|
|
20
|
use 5.10.0; |
|
|
2
|
|
|
|
|
4
|
|
|
2
|
2
|
|
|
2
|
|
7
|
use strict; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
33
|
|
|
3
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
91
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Map::Metro::Graph::Line; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Meta information about a line |
|
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY |
|
9
|
|
|
|
|
|
|
our $VERSION = '0.2404'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
6
|
use Map::Metro::Elk; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
77
|
|
|
12
|
2
|
|
|
2
|
|
2705
|
use Types::Standard qw/Str Int/; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
13
|
|
|
13
|
2
|
|
|
2
|
|
1188
|
use Map::Metro::Exceptions; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
525
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has id => ( |
|
16
|
|
|
|
|
|
|
is => 'ro', |
|
17
|
|
|
|
|
|
|
isa => Str, |
|
18
|
|
|
|
|
|
|
required => 1, |
|
19
|
|
|
|
|
|
|
); |
|
20
|
|
|
|
|
|
|
has name => ( |
|
21
|
|
|
|
|
|
|
is => 'ro', |
|
22
|
|
|
|
|
|
|
isa => Str, |
|
23
|
|
|
|
|
|
|
required => 1, |
|
24
|
|
|
|
|
|
|
); |
|
25
|
|
|
|
|
|
|
has description => ( |
|
26
|
|
|
|
|
|
|
is => 'ro', |
|
27
|
|
|
|
|
|
|
isa => Str, |
|
28
|
|
|
|
|
|
|
required => 1, |
|
29
|
|
|
|
|
|
|
); |
|
30
|
|
|
|
|
|
|
has color => ( |
|
31
|
|
|
|
|
|
|
is => 'rw', |
|
32
|
|
|
|
|
|
|
isa => Str, |
|
33
|
|
|
|
|
|
|
default => '#333333', |
|
34
|
|
|
|
|
|
|
); |
|
35
|
|
|
|
|
|
|
has width => ( |
|
36
|
|
|
|
|
|
|
is => 'rw', |
|
37
|
|
|
|
|
|
|
isa => Int, |
|
38
|
|
|
|
|
|
|
default => 3, |
|
39
|
|
|
|
|
|
|
); |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
around BUILDARGS => sub { |
|
42
|
|
|
|
|
|
|
my $orig = shift; |
|
43
|
|
|
|
|
|
|
my $self = shift; |
|
44
|
|
|
|
|
|
|
my %args = @_; |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
if($args{'id'} =~ m{([^a-z0-9])}i) { |
|
47
|
|
|
|
|
|
|
die lineid_contains_illegal_character line_id => $args{'id'}, illegal_character => $_; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
$self->$orig(%args); |
|
50
|
|
|
|
|
|
|
}; |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub to_hash { |
|
53
|
22
|
|
|
22
|
0
|
12
|
my $self = shift; |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
return { |
|
56
|
22
|
|
|
|
|
439
|
id => $self->id, |
|
57
|
|
|
|
|
|
|
name => $self->name, |
|
58
|
|
|
|
|
|
|
description => $self->description, |
|
59
|
|
|
|
|
|
|
color => $self->color, |
|
60
|
|
|
|
|
|
|
width => $self->width, |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=pod |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=encoding UTF-8 |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 NAME |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Map::Metro::Graph::Line - Meta information about a line |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 VERSION |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Version 0.2404, released 2016-04-30. |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Lines are currently only placeholders to identify the concept of a line. They don't have stations. |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 METHODS |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 id() |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Returns the line id given in the parsed map file. |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 name() |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Returns the line name given in the parsed map file. |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head2 description() |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Returns the line description given in the parsed map file. |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SOURCE |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
L<https://github.com/Csson/p5-Map-Metro> |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 HOMEPAGE |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
L<https://metacpan.org/release/Map-Metro> |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 AUTHOR |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Erik Carlsson <info@code301.com> |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Erik Carlsson. |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
117
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |