From c849a88b4ef549de2810b7f0e2b544bb7e88149e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 23 Jun 2019 16:52:50 +0200 Subject: train_number and departure are not needed when using from_json --- lib/Travel/Status/DE/DBWagenreihung.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index 4623225..ea37382 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -16,11 +16,11 @@ use Travel::Status::DE::DBWagenreihung::Wagon; sub new { my ( $class, %opt ) = @_; - if ( not $opt{train_number} ) { + if ( not $opt{train_number} and not $opt{from_json} ) { confess('train_number option must be set'); } - if ( not $opt{departure} ) { + if ( not $opt{departure} and not $opt{from_json} ) { confess('departure option must be set'); } -- cgit v1.2.3