From bf0b8b26f4484afb8b5d248e12f967e67d302547 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 23 Aug 2023 18:46:53 +0200 Subject: HAFAS(3pm): document similar_stops_p --- lib/Travel/Status/DE/HAFAS.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index b479e6f..e2c23c8 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -1015,11 +1015,11 @@ Request a polyline (series of geo-coordinates) indicating the train's route. =item my $status_p = Travel::Status::DE::HAFAS->new_p(I<%opt>) -Return a promise that resolves into a Travel::Status::DE::HAFAS instance +Returns a promise that resolves into a Travel::Status::DE::HAFAS instance ($status) on success and rejects with an error message on failure. If the failure occured after receiving a response from the HAFAS backend, the rejected promise contains a Travel::Status::DE::HAFAS instance as a second argument. -This instance can be used e.g. to call similar_stops in case of an ambiguous +This instance can be used e.g. to call similar_stops_p in case of an ambiguous location specifier. In addition to the arguments of B, the following mandatory arguments must be set. @@ -1099,6 +1099,21 @@ HAFAS backend could not identify the stop. See Travel::Status::DE::HAFAS::StopFinder(3pm)'s B method for details on the return value. +=item $status->similar_stops_p(I<%opt>) + +Returns a promise resolving to a list of hashrefs describing stops whose name +is similar to the one requested in the constructor's B parameter. +Returns nothing if the active service does not support this feature. This is +most useful if B returns 'LOCATION', which means that the HAFAS +backend could not identify the stop. + +See Travel::Status::DE::HAFAS::StopFinder(3pm)'s B method for details +on the resolved values. + +If $status has been created using B, this function does not require +arguments. Otherwise, the caller must specify B and B +(see B above). + =item $status->get_active_service Returns a hashref describing the active service when a service is active and -- cgit v1.2.3