summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/DBRIS
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-12-14 19:58:35 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-12-14 19:58:35 +0100
commitf6f56f81ffbf168c0fc313e63eb94911b88859dd (patch)
treedb0fdacdefaf5733edcca7692a35692ad06141f6 /lib/Travel/Status/DE/DBRIS
Initial commit
Diffstat (limited to 'lib/Travel/Status/DE/DBRIS')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Location.pm42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Location.pm b/lib/Travel/Status/DE/DBRIS/Location.pm
new file mode 100644
index 0000000..bb9a3ce
--- /dev/null
+++ b/lib/Travel/Status/DE/DBRIS/Location.pm
@@ -0,0 +1,42 @@
+package Travel::Status::DE::DBRIS::Location;
+
+use strict;
+use warnings;
+use 5.020;
+
+use parent 'Class::Accessor';
+
+our $VERSION = '0.01';
+
+Travel::Status::DE::DBRIS::Location->mk_ro_accessors(
+ qw(eva id lat lon name products type));
+
+sub new {
+ my ( $obj, %opt ) = @_;
+
+ my $json = $opt{json};
+
+ my $ref = {
+ eva => $json->{extId},
+ id => $json->{id},
+ lat => $json->{lat},
+ lon => $json->{lon},
+ name => $json->{name},
+ products => $json->{products},
+ type => $json->{type},
+ };
+
+ bless( $ref, $obj );
+
+ return $ref;
+}
+
+sub TO_JSON {
+ my ($self) = @_;
+
+ my $ret = { %{$self} };
+
+ return $ret;
+}
+
+1;