From d212b3f39be996ce6093b7a5389abea4c5c220f4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 14 Feb 2015 22:16:42 +0100 Subject: Result: Add raw_messages accessor (undocumented for now) --- lib/Travel/Status/DE/IRIS/Result.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm index 9296dc2..8b5c781 100644 --- a/lib/Travel/Status/DE/IRIS/Result.pm +++ b/lib/Travel/Status/DE/IRIS/Result.pm @@ -389,6 +389,26 @@ sub qos_messages { return @ret; } +sub raw_messages { + my ($self) = @_; + + my $strp = DateTime::Format::Strptime->new( + pattern => '%y%m%d%H%M', + time_zone => 'Europe/Berlin', + ); + + my @messages = reverse sort keys %{ $self->{messages} }; + my @ret = map { + [ + $strp->parse_datetime( $self->{messages}->{$_}->[0] ), + $self->{messages}->{$_}->[2] + ] + } @messages; + + return @ret; +} + + sub messages { my ($self) = @_; -- cgit v1.2.3