diff options
author | Daniel Friesel <derf@finalrewind.org> | 2013-09-23 12:55:48 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2013-09-23 12:55:48 +0200 |
commit | a1fe4868f85d267dfe092a7edfbadd4da007e960 (patch) | |
tree | 4c290156ec9fa8a61365f8196e3a3aeeacb008b0 | |
parent | eaf6d71d7811104fb78350d9c8b90cc873b141f8 (diff) |
Result.pm: Add JSON serializer
-rw-r--r-- | Changelog | 4 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DeutscheBahn/Result.pm | 6 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,7 @@ +git HEAD + + * Add primitive JSON serializer to Travel::Status::DE::DeutscheBahn::Result + Travel::Status::DE::DeutscheBahn 1.02 - Tue Sep 17 2013 * Respect proxy environment variables 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__ |