From a1fe4868f85d267dfe092a7edfbadd4da007e960 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 23 Sep 2013 12:55:48 +0200 Subject: Result.pm: Add JSON serializer --- lib/Travel/Status/DE/DeutscheBahn/Result.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/Travel/Status/DE/DeutscheBahn/Result.pm b/lib/Travel/Status/DE/DeutscheBahn/Result.pm index 8e127ae..9c62a71 100644 --- a/lib/Travel/Status/DE/DeutscheBahn/Result.pm +++ b/lib/Travel/Status/DE/DeutscheBahn/Result.pm @@ -131,6 +131,12 @@ sub route_timetable { return @{ $self->{route} }; } +sub TO_JSON { + my ($self) = @_; + + return { %{$self} }; +} + 1; __END__ -- cgit v1.2.3