diff options
author | dakkar <dakkar@thenautilus.net> | 2023-12-09 13:10:17 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2023-12-09 13:10:17 +0000 |
commit | 8bd30555a18dcab02dc95ea8b3701cdc7adbabb6 (patch) | |
tree | 4a2351d6111c8231fb04db72391ea2da5d60dbf3 /lib/WebService/TFL/Bus/Prediction.pm | |
parent | we can use the new weather api (diff) | |
download | HomePanel-8bd30555a18dcab02dc95ea8b3701cdc7adbabb6.tar.gz HomePanel-8bd30555a18dcab02dc95ea8b3701cdc7adbabb6.tar.bz2 HomePanel-8bd30555a18dcab02dc95ea8b3701cdc7adbabb6.zip |
new bus api
Diffstat (limited to 'lib/WebService/TFL/Bus/Prediction.pm')
-rw-r--r-- | lib/WebService/TFL/Bus/Prediction.pm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/WebService/TFL/Bus/Prediction.pm b/lib/WebService/TFL/Bus/Prediction.pm new file mode 100644 index 0000000..670baf7 --- /dev/null +++ b/lib/WebService/TFL/Bus/Prediction.pm @@ -0,0 +1,26 @@ +package WebService::TFL::Bus::Prediction; +use Moo; +use Types::Standard -all; +use Types::DateTime -all; +use namespace::clean; + +has [qw(stationName 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; |