diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-09-28 09:40:36 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-09-28 09:41:43 +0200 |
commit | 5c26e3b6a426343e2b3f852311fe0028ab7d75b8 (patch) | |
tree | b080f65a11c1f8bc8c4c694b552fb0cf828d8510 /lib/Travel/Status | |
parent | 99ebdfe5e7f171c3fc312b2a8f61e1480fdf991d (diff) |
Move static service accessors to Travel::Status::DE::EFA
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r-- | lib/Travel/Status/DE/EFA.pm | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm index b95ff41..6aa505b 100644 --- a/lib/Travel/Status/DE/EFA.pm +++ b/lib/Travel/Status/DE/EFA.pm @@ -404,6 +404,16 @@ sub result { return Travel::Status::DE::EFA::Trip->new( json => $self->{response} ); } +# static +sub get_service_ids { + return Travel::Status::DE::EFA::Services::get_service_ids(@_); +} + +# static +sub get_service { + return Travel::Status::DE::EFA::Services::get_service(@_); +} + 1; __END__ @@ -547,6 +557,41 @@ nothing (undef / empty list) otherwise. Returns a list of Travel::Status::DE::EFA::Departure(3pm) objects, each one describing one departure. +=item Travel::Status::DE::EFA::get_service_ids() + +Returns the list of supported services (backends). + +=item Travel::Status::DE::EFA::get_service(I<service>) + +Returns a hashref describing the requested I<service> ID with the following keys. + +=over + +=item B<name> => I<string> + +Provider name, e.g. Verkehrsverbund Oberelbe. + +=item B<url> => I<string> + +Backend base URL. + +=item B<homepage> => I<string> (optional) + +Provider homepage. + +=item B<languages> => I<arrayref> (optional) + +Supportde languages, e.g. de, en. + +=item B<coverage> => I<hashref> + +Area in which the service provides near-optimal coverage. Typically, this +means a (nearly) complete list of departures and real-time data. The +hashref contains two optional keys: B<area> (GeoJSON) and B<regions> (list of +strings, e.g. "DE" or "CH-BE"). + +=back + =back =head1 DIAGNOSTICS |