NAME

Travel::Routing::DE::EFA::Route::Message - contains a message related to a route or route part.

SYNOPSIS

for my $m ($routepart->regular_notes, $routepart->current_notes) {
    if ($m->is_detailed) {
        printf("%s: %s\n", $m->subtitle, $m->subject);
    }
    else {
        say $m->summary;
    }
}

VERSION

version 2.24

DESCRIPTION

Travel::Routing::DE::EFA::Route::Message contains information about a specific route or route part, such as wheelchair accessibility, unscheduled route diversions and cancelled stops. Often, this information is not used in the backend's route calculation, so a message may invalidate a certain route or route part.

There are two types of messages provided by the backend: oneliners and detailed messages. There is no known distinction regarding their type or content. Also, there are some other backend-provided fields not yet covered by this module, so expect changes in future releases.

A oneline message consists of a single string which can be accesed using subject or summary and its is_detailed accessor returns false.

A detailed message has a subject, subtitle, summary and detailed HTML content.

METHODS

ACCESSORS

$message->is_detailed

True if all accessors (fields) are set, false otherwise. When this field is false, only summary and subject are set (and they will return the same string).

$message->summary

Message summary.

$message->subject

Message subject. May be the same string as the subtitle.

$message->subtitle

Message subtitle. May be the same string as the summary.

$message->raw_content

Raw HTML content. May contain information not available via any other accessor.

DIAGNOSTICS

None.

DEPENDENCIES

None.

BUGS AND LIMITATIONS

This module does not yet provide access to all data provided by the backend. Most notably, raw_content is not properly parsed yet.

SEE ALSO

Travel::Routing::DE::EFA(3pm), Travel::Routing::DE::EFA::Route::Part(3pm).

AUTHOR

Copyright (C) 2015 by Birte Kristina Friesel <derf@finalrewind.org>

LICENSE

This program is licensed under the same terms as Perl itself.