summaryrefslogtreecommitdiff
path: root/bin/efa
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-23 11:14:22 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-23 11:14:22 +0200
commit4da3a72be49f769c307381d92320bc7baefe2a01 (patch)
treee3f0502f3298c14eb04891e1db4a0ea84abb9c82 /bin/efa
parent194c4ee9eb2eb8eb45af78b8feed39ef53615e1b (diff)
Introducing ::Route and ::Route::Part
Diffstat (limited to 'bin/efa')
-rwxr-xr-xbin/efa16
1 files changed, 9 insertions, 7 deletions
diff --git a/bin/efa b/bin/efa
index 820ff52..f257532 100755
--- a/bin/efa
+++ b/bin/efa
@@ -100,12 +100,12 @@ $efa->submit( timeout => $opt->{'timeout'} );
$efa->parse();
-my @connections = $efa->connections();
+my @routes = $efa->routes();
-for my $i ( 0 .. $#connections ) {
- for my $c ( @{ $connections[$i] } ) {
+for my $i ( 0 .. $#routes ) {
+ for my $c ( $routes[$i]->parts() ) {
- for my $extra ( @{ $c->{'extra'} } ) {
+ for my $extra ( $c->extra() ) {
if ( not( length $ignore_info and $extra =~ /$ignore_info/i ) ) {
say "# $extra";
@@ -114,11 +114,13 @@ for my $i ( 0 .. $#connections ) {
printf(
"%-5s ab %-30s %-20s %s\n%-5s an %-30s\n\n",
- $c->{'dep_time'}, $c->{'dep_stop'}, $c->{'train_line'},
- $c->{'train_dest'}, $c->{'arr_time'}, $c->{'arr_stop'},
+ $c->get(
+ qw(dep_time dep_stop train_line train_dest arr_time
+ arr_stop)
+ ),
);
}
- if ( $i != $#connections ) {
+ if ( $i != $#routes ) {
print "------\n\n";
}
}