summaryrefslogtreecommitdiff
path: root/lib/WebService/TFL/Bus/Prediction.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/WebService/TFL/Bus/Prediction.pm')
-rw-r--r--lib/WebService/TFL/Bus/Prediction.pm26
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..8873b02
--- /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 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;