summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/DBWagenreihung
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel/Status/DE/DBWagenreihung')
-rw-r--r--lib/Travel/Status/DE/DBWagenreihung/Group.pm24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/DBWagenreihung/Group.pm b/lib/Travel/Status/DE/DBWagenreihung/Group.pm
index 76fc159..a627b6e 100644
--- a/lib/Travel/Status/DE/DBWagenreihung/Group.pm
+++ b/lib/Travel/Status/DE/DBWagenreihung/Group.pm
@@ -10,7 +10,8 @@ use parent 'Class::Accessor';
our $VERSION = '0.13';
Travel::Status::DE::DBWagenreihung::Group->mk_ro_accessors(
- qw(id train_no type origin destination));
+ qw(id train_no type description desc_short origin destination has_sections)
+);
sub new {
my ( $obj, %opt ) = @_;
@@ -19,6 +20,21 @@ sub new {
return bless( $ref, $obj );
}
+sub set_description {
+ my ( $self, $desc, $short ) = @_;
+
+ $self->{description} = $desc;
+ $self->{desc_short} = $short;
+}
+
+sub set_sections {
+ my ( $self, @sections ) = @_;
+
+ $self->{sections} = [@sections];
+
+ $self->{has_sections} = 1;
+}
+
sub set_traintype {
my ( $self, $i, $tt ) = @_;
$self->{type} = $tt;
@@ -35,6 +51,12 @@ sub sort_wagons {
@{ $self->{wagons} };
}
+sub sections {
+ my ($self) = @_;
+
+ return @{ $self->{sections} // [] };
+}
+
sub wagons {
my ($self) = @_;