diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-05 04:55:35 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-05 04:55:35 +0200 |
commit | 419910edcd32777bdea5ca9c2e9ba900bab70ffe (patch) | |
tree | 1bbb1a449b4fe2d3e3c456a5884b1d045c2708cb /lib | |
parent | 09e73c73ca20c19af3461eff6c5ce27bd1ea9120 (diff) |
EFA: Replace ->stop_name, ->stop_id with ->stop
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travel/Status/DE/EFA.pm | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm index fd37756..90e26e8 100644 --- a/lib/Travel/Status/DE/EFA.pm +++ b/lib/Travel/Status/DE/EFA.pm @@ -388,16 +388,23 @@ sub check_for_ambiguous { return; } -sub stop_name { +sub stop { my ($self) = @_; + if ( $self->{stop} ) { + return $self->{stop}; + } - return $self->{response}{dm}{points}{point}{name}; -} + my $point = $self->{response}{dm}{points}{point}; + my $place = $point->{ref}{place}; -sub stop_id { - my ($self) = @_; + $self->{stop} = Travel::Status::DE::EFA::Stop->new( + place => $place, + full_name => $point->{name}, + name => $point->{name} =~ s{\Q$place\E,? ?}{}r, + id => $point->{stateless}, + ); - return $self->{response}{dm}{points}{point}{stateless}; + return $self->{stop}; } sub stops { |