line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Travel::Status::DE::HAFAS::Message; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
5
|
1
|
|
|
1
|
|
24
|
use 5.014; |
|
1
|
|
|
|
|
4
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use parent 'Class::Accessor'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '4.16'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Travel::Status::DE::HAFAS::Message->mk_ro_accessors( |
12
|
|
|
|
|
|
|
qw(short text code prio is_him ref_count)); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
1
|
|
|
1
|
1
|
10
|
my ( $obj, %conf ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
3
|
my $ref = \%conf; |
18
|
1
|
|
|
|
|
3
|
bless( $ref, $obj ); |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
4
|
return $ref; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub TO_JSON { |
24
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return { %{$self} }; |
|
0
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Travel::Status::DE::HAFAS::Message - An arrival/departure-related message. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SYNOPSIS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
if ($message->text) { |
40
|
|
|
|
|
|
|
printf("%s: %s\n", $message->short, $message->text); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
else { |
43
|
|
|
|
|
|
|
say $message->short; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
version 4.16 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Travel::Status::DE::HAFAS::Message describes a message belonging to an |
53
|
|
|
|
|
|
|
arrival or departure. Messages may refer to planned schedule changes due to |
54
|
|
|
|
|
|
|
construction work, the expected passenger volume, or similar. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 METHODS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 ACCESSORS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=over |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item $message->short |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Message header. May be a concise single-sentence summary or a mostly useless |
65
|
|
|
|
|
|
|
string such as "Information". Does not contain newlines. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item $message->text |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Detailed message content. Does not contain newlines. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item $message->ref_count |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Counter indicating how often this message is used by the requested |
74
|
|
|
|
|
|
|
arrivals/departures. ref_count is an integer between 1 and the number of |
75
|
|
|
|
|
|
|
results. If ref_count is 1, it is referenced by a single result only. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item $message->is_him |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
True if it is a HIM message (typically used for service information), false |
80
|
|
|
|
|
|
|
if not (message may be a REM instead, indicating e.g. presence of a bicycle |
81
|
|
|
|
|
|
|
carriage or WiFi). |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=back |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 DIAGNOSTICS |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
None. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=over |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item Class::Accessor(3pm) |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=back |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
None known. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 SEE ALSO |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Travel::Status::DE::HAFAS(3pm). |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 AUTHOR |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Copyright (C) 2020-2022 by Birte Kristina Friesel E<lt>derf@finalrewind.orgE<gt> |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 LICENSE |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This module is licensed under the same terms as Perl itself. |