Loading lib/Travel/Status/DE/HAFAS.pm +5 −14 Original line number Diff line number Diff line Loading @@ -617,14 +617,10 @@ sub check_mgate { sub add_message { my ( $self, $json, $is_him ) = @_; my $short = $json->{txtS}; my $text = $json->{txtN}; my $type = $json->{type}; my $code = $json->{code}; my $prio = $json->{prio}; if ($is_him) { $short = $json->{head}; $text = $json->{text}; $code = $json->{hid}; } Loading @@ -642,12 +638,7 @@ sub add_message { } my $message = Travel::Status::DE::HAFAS::Message->new( short => $short, text => $text, type => $type, code => $code, prio => $prio, is_him => $is_him, json => $json, ref_count => 1, ); push( @{ $self->{messages} }, $message ); Loading lib/Travel/Status/DE/HAFAS/Message.pm +25 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,31 @@ Travel::Status::DE::HAFAS::Message->mk_ro_accessors( sub new { my ( $obj, %conf ) = @_; my $ref = \%conf; my $json = $conf{json}; my $is_him = $conf{is_him}; my $short = $json->{txtS}; my $text = $json->{txtN}; my $type = $json->{type}; my $code = $json->{code}; my $prio = $json->{prio}; if ($is_him) { $short = $json->{head}; $text = $json->{text}; $code = $json->{hid}; } my $ref = { short => $short, text => $text, type => $type, code => $code, prio => $prio, is_him => $is_him, ref_count => $conf{ref_count}, }; bless( $ref, $obj ); return $ref; Loading Loading
lib/Travel/Status/DE/HAFAS.pm +5 −14 Original line number Diff line number Diff line Loading @@ -617,14 +617,10 @@ sub check_mgate { sub add_message { my ( $self, $json, $is_him ) = @_; my $short = $json->{txtS}; my $text = $json->{txtN}; my $type = $json->{type}; my $code = $json->{code}; my $prio = $json->{prio}; if ($is_him) { $short = $json->{head}; $text = $json->{text}; $code = $json->{hid}; } Loading @@ -642,12 +638,7 @@ sub add_message { } my $message = Travel::Status::DE::HAFAS::Message->new( short => $short, text => $text, type => $type, code => $code, prio => $prio, is_him => $is_him, json => $json, ref_count => 1, ); push( @{ $self->{messages} }, $message ); Loading
lib/Travel/Status/DE/HAFAS/Message.pm +25 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,31 @@ Travel::Status::DE::HAFAS::Message->mk_ro_accessors( sub new { my ( $obj, %conf ) = @_; my $ref = \%conf; my $json = $conf{json}; my $is_him = $conf{is_him}; my $short = $json->{txtS}; my $text = $json->{txtN}; my $type = $json->{type}; my $code = $json->{code}; my $prio = $json->{prio}; if ($is_him) { $short = $json->{head}; $text = $json->{text}; $code = $json->{hid}; } my $ref = { short => $short, text => $text, type => $type, code => $code, prio => $prio, is_him => $is_him, ref_count => $conf{ref_count}, }; bless( $ref, $obj ); return $ref; Loading