summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Routing/DE/HAFAS.pm30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/Travel/Routing/DE/HAFAS.pm b/lib/Travel/Routing/DE/HAFAS.pm
index 12995c1..70914bb 100644
--- a/lib/Travel/Routing/DE/HAFAS.pm
+++ b/lib/Travel/Routing/DE/HAFAS.pm
@@ -608,4 +608,34 @@ sub connections {
return @{ $self->{results} };
}
+# static
+sub get_services {
+ my @services;
+ for my $service ( sort keys %hafas_instance ) {
+ my %desc = %{ $hafas_instance{$service} };
+ $desc{shortname} = $service;
+ push( @services, \%desc );
+ }
+ return @services;
+}
+
+# static
+sub get_service {
+ my ($service) = @_;
+
+ if ( defined $service and exists $hafas_instance{$service} ) {
+ return $hafas_instance{$service};
+ }
+ return;
+}
+
+sub get_active_service {
+ my ($self) = @_;
+
+ if ( defined $self->{active_service} ) {
+ return $hafas_instance{ $self->{active_service} };
+ }
+ return;
+}
+
# }}}