summaryrefslogtreecommitdiff
path: root/lib/WebService/TFL/TubeStatus/Response/LineStatus.pm
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2023-12-09 14:07:20 +0000
committerdakkar <dakkar@thenautilus.net>2023-12-09 14:07:20 +0000
commit1a37c7e52d5433e8182d444d12a55fdd9b8a2770 (patch)
tree2f0ed93dd07e6c078a5fb03cb9539ec93772fe23 /lib/WebService/TFL/TubeStatus/Response/LineStatus.pm
parentbump perl (diff)
parentsort buses (diff)
downloadHomePanel-1a37c7e52d5433e8182d444d12a55fdd9b8a2770.tar.gz
HomePanel-1a37c7e52d5433e8182d444d12a55fdd9b8a2770.tar.bz2
HomePanel-1a37c7e52d5433e8182d444d12a55fdd9b8a2770.zip
Merge branch 'new-api'
Diffstat (limited to 'lib/WebService/TFL/TubeStatus/Response/LineStatus.pm')
-rw-r--r--lib/WebService/TFL/TubeStatus/Response/LineStatus.pm24
1 files changed, 7 insertions, 17 deletions
diff --git a/lib/WebService/TFL/TubeStatus/Response/LineStatus.pm b/lib/WebService/TFL/TubeStatus/Response/LineStatus.pm
index 6caa7d6..2e8e22b 100644
--- a/lib/WebService/TFL/TubeStatus/Response/LineStatus.pm
+++ b/lib/WebService/TFL/TubeStatus/Response/LineStatus.pm
@@ -1,33 +1,23 @@
package WebService::TFL::TubeStatus::Response::LineStatus;
use Moo;
use Types::Standard -all;
-use namespace::autoclean;
+use namespace::clean;
-has is_active => (
+has [qw(statusSeverity statusSeverityDescription)] => (
is => 'ro',
- isa => Bool,
+ isa => Str,
required => 1,
);
-has [qw(code class description details)] => (
+has reason => (
is => 'ro',
isa => Str,
- required => 1,
);
-sub new_from_xml {
- my ($class,$ls,$xpath) = @_;
-
- my %init_arg;
-
- my ($status) = $xpath->findnodes(q{ws:Status},$ls);
- $init_arg{code} = $status->findvalue(q{@ID});
- $init_arg{is_active} = $status->findvalue(q{@IsActive}) eq 'true';
- $init_arg{class} = $status->findvalue(q{@CssClass});
- $init_arg{description} = $status->findvalue(q{@Description});
- $init_arg{details} = $ls->findvalue(q{@StatusDetails});
+sub new_from_response {
+ my ($class,$response_data) = @_;
- return $class->new(\%init_arg);
+ return $class->new($response_data);
}
1;