diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-11-25 15:03:01 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-11-25 15:03:01 +0100 |
commit | acaf6fec0ea994e2901ebffbdd4bd3f5b46c77d6 (patch) | |
tree | 48064d46b53f54129454d3b580429fd250428352 /lib/Travel/Status/DE/DBWagenreihung |
Initial commit
Diffstat (limited to 'lib/Travel/Status/DE/DBWagenreihung')
-rw-r--r-- | lib/Travel/Status/DE/DBWagenreihung/Wagon.pm | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm b/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm new file mode 100644 index 0000000..f3569c3 --- /dev/null +++ b/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm @@ -0,0 +1,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; |