summaryrefslogtreecommitdiff
path: root/lib/WebService/TFL/Bus/ResponseTypeRole.pm
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2023-12-09 13:10:17 +0000
committerdakkar <dakkar@thenautilus.net>2023-12-09 13:10:17 +0000
commit8bd30555a18dcab02dc95ea8b3701cdc7adbabb6 (patch)
tree4a2351d6111c8231fb04db72391ea2da5d60dbf3 /lib/WebService/TFL/Bus/ResponseTypeRole.pm
parentwe can use the new weather api (diff)
downloadHomePanel-8bd30555a18dcab02dc95ea8b3701cdc7adbabb6.tar.gz
HomePanel-8bd30555a18dcab02dc95ea8b3701cdc7adbabb6.tar.bz2
HomePanel-8bd30555a18dcab02dc95ea8b3701cdc7adbabb6.zip
new bus api
Diffstat (limited to 'lib/WebService/TFL/Bus/ResponseTypeRole.pm')
-rw-r--r--lib/WebService/TFL/Bus/ResponseTypeRole.pm38
1 files changed, 0 insertions, 38 deletions
diff --git a/lib/WebService/TFL/Bus/ResponseTypeRole.pm b/lib/WebService/TFL/Bus/ResponseTypeRole.pm
deleted file mode 100644
index 7f48419..0000000
--- a/lib/WebService/TFL/Bus/ResponseTypeRole.pm
+++ /dev/null
@@ -1,38 +0,0 @@
-package WebService::TFL::Bus::ResponseTypeRole;
-use Package::Variant
- importing => [ 'Moo::Role'],
- subs => [ 'has' ];
-use WebService::TFL::Bus::Fields;
-use WebService::TFL::Bus::Types 'DateTimeMillis';
-
-sub make_variant {
- my ($class,$target_package,$type) = @_;
-
- my $method = $type . '_return_fields';
- my @fields = WebService::TFL::Bus::Fields->$method;
-
- for my $field (@fields) {
- has $field => (
- is => 'ro',
- ( $field =~ /Time$/ ? (
- isa => DateTimeMillis,
- coerce => DateTimeMillis->coercion,
- ) : () ),
- );
- }
-
- install new_from_array => sub {
- my ($class,$return_set,$array) = @_;
-
- my %args;
- my $i=1;
- for my $field (@fields) {
- next unless exists $return_set->{$field};
- $args{$field}=$array->[$i];
- ++$i;
- }
- return $class->new(\%args);
- }
-}
-
-1;