summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r--lib/Travel/Status/DE/EFA.pm19
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 {