diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travel/Status/DE/DBWagenreihung.pm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index dc120af..5e612dd 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -183,6 +183,25 @@ sub errstr { return $self->{errstr}; } +sub TO_JSON { + my ($self) = @_; + + # ensure that all objects are available + $self->direction; + $self->origins; + $self->destinations; + $self->train_numbers; + $self->train_descriptions; + $self->wagons; + $self->{platform} = $self->platform; + + my %copy = %{$self}; + + delete $copy{from_json}; + + return {%copy}; +} + sub direction { my ($self) = @_; |