-
Birte Kristina Friesel authoredBirte Kristina Friesel authored
Message.pm 1.91 KiB
package Travel::Status::DE::HAFAS::Message;
use strict;
use warnings;
use 5.014;
use parent 'Class::Accessor';
our $VERSION = '4.12';
Travel::Status::DE::HAFAS::Message->mk_ro_accessors(
qw(short text code prio is_him ref_count));
sub new {
my ( $obj, %conf ) = @_;
my $ref = \%conf;
bless( $ref, $obj );
return $ref;
}
sub TO_JSON {
my ($self) = @_;
return { %{$self} };
}
1;
__END__
=head1 NAME
Travel::Status::DE::HAFAS::Message - An arrival/departure-related message.
=head1 SYNOPSIS
if ($message->text) {
printf("%s: %s\n", $message->short, $message->text);
}
else {
say $message->short;
}
=head1 VERSION
version 4.12
=head1 DESCRIPTION
Travel::Status::DE::HAFAS::Message describes a message belonging to an
arrival or departure. Messages may refer to planned schedule changes due to
construction work, the expected passenger volume, or similar.
=head1 METHODS
=head2 ACCESSORS
=over
=item $message->short
Message header. May be a concise single-sentence summary or a mostly useless
string such as "Information". Does not contain newlines.
=item $message->text
Detailed message content. Does not contain newlines.