summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-04-26 22:02:29 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-04-26 22:02:29 +0200
commit27a80b67a73c33469cf136ca37b6d3d9f2a346f7 (patch)
treefd0eb93324c51ea4f188082456b63b8bfee67dba
parent75a92d7144bd8700d25d3d420072d8b9f4418d4d (diff)
Replace station_{ds100,uic,name} accessors with station->{ds100,eva,name}
-rwxr-xr-xbin/db-wagenreihung2
-rw-r--r--lib/Travel/Status/DE/DBWagenreihung.pm32
2 files changed, 5 insertions, 29 deletions
diff --git a/bin/db-wagenreihung b/bin/db-wagenreihung
index 7a1d63c..87b5223 100755
--- a/bin/db-wagenreihung
+++ b/bin/db-wagenreihung
@@ -82,7 +82,7 @@ printf(
),
);
-printf( "%s Gleis %s\n\n", $wr->station_name, $wr->platform );
+printf( "%s Gleis %s\n\n", $wr->station->{name}, $wr->platform );
for my $section ( $wr->sections ) {
my $section_length = $section->length_percent;
diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm
index aa3cd8f..eaaabd0 100644
--- a/lib/Travel/Status/DE/DBWagenreihung.pm
+++ b/lib/Travel/Status/DE/DBWagenreihung.pm
@@ -334,24 +334,6 @@ sub sections {
return @{ $self->{sections} // [] };
}
-sub station_ds100 {
- my ($self) = @_;
-
- return $self->{data}{istformation}{halt}{rl100};
-}
-
-sub station_name {
- my ($self) = @_;
-
- return $self->{data}{istformation}{halt}{bahnhofsname};
-}
-
-sub station_uic {
- my ($self) = @_;
-
- return $self->{data}{istformation}{halt}{evanummer};
-}
-
sub train_numbers {
my ($self) = @_;
@@ -882,17 +864,11 @@ Returns the platform name.
Describes the sections of the platform this train will depart from.
Returns a list of L<Travel::Status::DE::DBWagenreihung::Section> objects.
-=item $wr->station_ds100
-
-Returns the DS100 identifier of the requested station.
-
-=item $wr->station_name
-
-Returns the name of the requested station.
-
-=item $wr->station_uic
+=item $wr->station
-Returns the international id (UIC ID / IBNR) of the requested station.
+Returns a hashref describing the requested station. The hashref contains three
+entries: B<ds100> (DS100 / Ril100 identifier), B<eva> (EVA ID, related to but
+not necessarily identical with UIC station ID), and B<name> (station name).
=item $wr->train_descriptions