Group
Extension

Matches 6

Travel-Status-DE-DBWagenreihung ( D/DE/DERF/Travel-Status-DE-DBWagenreihung-0.18.tar.gz, DERF, 2024; MetaCPAN )
Travel-Status-DE-DBWagenreihung/lib/Travel/Status/DE/DBWagenreihung.pm ( view source; MetaCPAN )
se warnings;
use 5.020;
use utf8;

use parent 'Class::Accessor';

use Carp qw(cluck confess);
use JSON;
use List::Util qw(uniq);
use LWP::UserAgent;
use Travel::Status::DE::DBWagenreihung::Group;
use 
if ( not $opt{train_number} and not $opt{from_json} ) {
		confess('train_number option must be set');
	}

	if ( not $opt{departure} and not $opt{from_json} ) {
		confess('departure option must be set'
departure      => $opt{departure},
		eva            => $opt{eva},
		from_json      => $opt{from_json},
		json           => JSON->new,
		train_type     => $opt{train_type},
		train_number   => $opt{tra
Travel-Status-DE-DBWagenreihung ( D/DE/DERF/Travel-Status-DE-DBWagenreihung-0.18.tar.gz, DERF, 2024; MetaCPAN )
Travel-Status-DE-DBWagenreihung/lib/Travel/Status/DE/DBWagenreihung/Carriage.pm ( view source; MetaCPAN )
          => 'infant_cabin',
);

sub new {
	my ( $obj, %opt ) = @_;
	my $ref = {};

	my %json     = %{ $opt{json} };
	my $platform = $opt{platform};

	$ref->{class_type}    = 0;
	$ref->{has_bistro}   
	$ref->{number}        = $json{wagonIdentificationNumber};
	$ref->{model}         = $json{vehicleID};
	$ref->{uic_id}        = $json{vehicleID};
	$ref->{section}       = $json{platformPosition}{sector
   = $json{type}{constructionType};

	$ref->{model} =~ s{^.....(...)....(?:-.)?$}{$1} or $ref->{model} = undef;

	my $self = bless( $ref, $obj );

	$self->parse_type;

	for my $amenity ( @{ $json{amen
Travel-Status-DE-DBWagenreihung ( D/DE/DERF/Travel-Status-DE-DBWagenreihung-0.18.tar.gz, DERF, 2024; MetaCPAN )
Travel-Status-DE-DBWagenreihung/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm ( view source; MetaCPAN )
type} =~ m{^D?A?B} ) {
		return 1;
	}
	return 0;
}

sub sections {
	my ($self) = @_;

	return @{ $self->{sections} };
}

sub TO_JSON {
	my ($self) = @_;

	my %copy = %{$self};

	return {%copy};
}

1;
Travel-Status-DE-DBWagenreihung ( D/DE/DERF/Travel-Status-DE-DBWagenreihung-0.18.tar.gz, DERF, 2024; MetaCPAN )
Travel-Status-DE-DBWagenreihung/lib/Travel/Status/DE/DBWagenreihung/Group.pm ( view source; MetaCPAN )
my %json = %{ $opt{json} };

	my $ref = {
		carriages   => $opt{carriages},
		destination => $json{transport}{destination}{name},
		train_type  => $json{transport}{category},
		name        => $json{na
me},
		line        => $json{transport}{numberwline},
		train_no    => $json{transport}{number},
	};

	if ( $ref->{name} =~ m{ ^ IC[DE] 0* (\d+) $ }x and exists $ice_name{$1} ) {
		$ref->{designation} 


	$ref->{sectors} = [
		uniq grep { defined }
		  map     { $_->{platformPosition}{sector} } @{ $json{vehicles} // [] }
	];
	if ( @{ $ref->{sectors} } ) {
		$ref->{has_sectors} = 1;
	}

	$ref->{start
Travel-Status-DE-DBWagenreihung ( D/DE/DERF/Travel-Status-DE-DBWagenreihung-0.18.tar.gz, DERF, 2024; MetaCPAN )
Travel-Status-DE-DBWagenreihung/lib/Travel/Status/DE/DBWagenreihung/Sector.pm ( view source; MetaCPAN )
_meters cube_meters cube_percent)
);

sub new {
	my ( $obj, %opt ) = @_;

	my %section  = %{ $opt{json} };
	my %platform = %{ $opt{platform} };

	my $platform_length = $platform{end} - $platform{start
orm_length,
	};

	$ref->{length_percent} = $ref->{end_percent} - $ref->{start_percent};

	return bless( $ref, $obj );
}

sub TO_JSON {
	my ($self) = @_;

	my %copy = %{$self};

	return {%copy};
}

1;
Travel-Status-DE-DBWagenreihung ( D/DE/DERF/Travel-Status-DE-DBWagenreihung-0.18.tar.gz, DERF, 2024; MetaCPAN )
Travel-Status-DE-DBWagenreihung/lib/Travel/Status/DE/DBWagenreihung/Section.pm ( view source; MetaCPAN )
>{start_meters};
	$ref->{length_percent} = $ref->{end_percent} - $ref->{start_percent};

	return bless( $ref, $obj );
}

sub TO_JSON {
	my ($self) = @_;

	my %copy = %{$self};

	return {%copy};
}

1;

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.