blob: 4fe652402dcc46de0f1d6e0e240382f2ece4f9fa (
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
|
package WebService::TFL::TubeStatus::Response; use Moo; use WebService::TFL::TubeStatus::Response::Line; use Types::Standard -all; use namespace::autoclean; has lines => ( is => 'ro', isa => ArrayRef[InstanceOf['WebService::TFL::TubeStatus::Response::Line']], required => 1, ); sub new_from_response { my ($class,$response_data) = @_; return $class->new({ lines=> [ map { WebService::TFL::TubeStatus::Response::Line->new_from_response($_) } grep { $_->{'$type'} =~ /\bLine\b/ } $response_data->@* ], }); } 1;
|