summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm
blob: f3569c36d3a807291a4981893f2896b3af6e22d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package Travel::Status::DE::DBWagenreihung::Wagon;

use strict;
use warnings;
use 5.020;
use utf8;

use parent 'Class::Accessor';
use Carp qw(cluck);

our $VERSION = '1.21';

Travel::Status::DE::DBWagenreihung::Wagon->mk_ro_accessors(
	qw(number section)
);

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

	$ref->{number} = $ref->{wagenordnungsnummer};
	$ref->{section} = $ref->{fahrzeugsektor};

	return bless( $ref, $obj );
}

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

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

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

	my %copy = %{$self};

	return {%copy};
}

1;