summaryrefslogtreecommitdiff
path: root/lib/WebService/TFL/Bus/Prediction.pm
blob: 8873b028665fcd909119d0462a91da2fe2e7016b (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
26
package WebService::TFL::Bus::Prediction; 
use Moo;
use Types::Standard -all;
use Types::DateTime -all;
use namespace::clean;
 
has [qw(stationName destinationName lineName towards)] => (
    is => 'ro',
    isa => Str,
    required => 1,
);
 
has 'expectedArrival' => (
    is => 'ro',
    isa => DateTimeUTC->plus_coercions( Format['ISO8601'] ),
    required => 1,
    coerce => 1,
);
 
sub new_from_response {
    my ($class,$response_data) = @_;
 
    return $class->new($response_data);
}
 
1;