summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-09-22 15:08:23 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-09-22 15:08:23 +0200
commit3dd1b3a53d48c5b1c76418fe37823ea97e58ccde (patch)
treef22f2b21ec93f95093908bae5cf3621bc9a083e8
parent1496b2a00bcbf0c2875a2b88b95ee39524cece6e (diff)
Stop: Use place / name / full_name rather than just name_suf and name
-rwxr-xr-xbin/efa-m14
-rw-r--r--lib/Travel/Status/DE/EFA.pm11
-rw-r--r--lib/Travel/Status/DE/EFA/Stop.pm10
3 files changed, 20 insertions, 15 deletions
diff --git a/bin/efa-m b/bin/efa-m
index 36c23ea..7530326 100755
--- a/bin/efa-m
+++ b/bin/efa-m
@@ -172,7 +172,7 @@ sub format_route {
$output .= sprintf(
" %5s %40s %s\n",
$stop->arr->strftime('%H:%M'),
- $stop->name, $stop->platform,
+ $stop->full_name, $stop->platform,
);
}
else {
@@ -180,7 +180,7 @@ sub format_route {
"%5s → %5s %40s %s\n",
$stop->arr->strftime('%H:%M'),
$stop->dep->strftime('%H:%M'),
- $stop->name, $stop->platform,
+ $stop->full_name, $stop->platform,
);
}
}
@@ -188,19 +188,19 @@ sub format_route {
$output .= sprintf(
"%5s %40s %s\n",
$stop->arr->strftime('%H:%M'),
- $stop->name, $stop->platform,
+ $stop->full_name, $stop->platform,
);
}
elsif ( defined $stop->dep ) {
$output .= sprintf(
" %5s %40s %s\n",
$stop->dep->strftime('%H:%M'),
- $stop->name, $stop->platform,
+ $stop->full_name, $stop->platform,
);
}
- elsif ( $stop->name ) {
+ elsif ( $stop->full_name ) {
$output .= sprintf( " %40s %s\n",
- $stop->name, $stop->platform, );
+ $stop->full_name, $stop->platform, );
}
else {
$output .= "?\n";
@@ -346,7 +346,7 @@ sub show_results {
if ( $edata{route} ) {
$output_line[3]
- = join( q{ }, map { $_->name_suf } $d->route_interesting );
+ = join( q{ }, map { $_->name } $d->route_interesting );
}
elsif ( $d->occupancy ) {
if ( $d->occupancy eq 'MANY_SEATS' ) {
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm
index e95bbcd..ab029df 100644
--- a/lib/Travel/Status/DE/EFA.pm
+++ b/lib/Travel/Status/DE/EFA.pm
@@ -419,11 +419,12 @@ sub parse_route {
push(
@ret,
Travel::Status::DE::EFA::Stop->new(
- arr => $arr,
- dep => $dep,
- name => $stop->{name},
- name_suf => $stop->{nameWO},
- platform => $ref->{platform} || $stop->{platformName} || undef,
+ arr => $arr,
+ dep => $dep,
+ full_name => $stop->{name},
+ place => $stop->{place},
+ name => $stop->{nameWO},
+ platform => $ref->{platform} || $stop->{platformName} || undef,
)
);
}
diff --git a/lib/Travel/Status/DE/EFA/Stop.pm b/lib/Travel/Status/DE/EFA/Stop.pm
index 250b347..609c197 100644
--- a/lib/Travel/Status/DE/EFA/Stop.pm
+++ b/lib/Travel/Status/DE/EFA/Stop.pm
@@ -9,7 +9,7 @@ use parent 'Class::Accessor';
our $VERSION = '2.02';
Travel::Status::DE::EFA::Stop->mk_ro_accessors(
- qw(arr dep name name_suf platform));
+ qw(arr dep place name full_name platform));
sub new {
my ( $obj, %conf ) = @_;
@@ -71,12 +71,16 @@ first scheduled stop.
DateTime(3pm) object holding departure date and time. undef if this is the
final scheduled stop.
-=item $stop->name
+=item $stop->place
+
+City name, for instance "Essen".
+
+=item $stop->full_name
stop name with city prefix ("I<City> I<Stop>", for instance
"Essen RE<uuml>ttenscheider Stern").
-=item $stop->name_suf
+=item $stop->name
stop name without city prefix, for instance "RE<uuml>ttenscheider Stern".