diff options
Diffstat (limited to 'lib/Sietima/Subscriber.pm')
-rw-r--r-- | lib/Sietima/Subscriber.pm | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/Sietima/Subscriber.pm b/lib/Sietima/Subscriber.pm index b888efb..cbaf4c2 100644 --- a/lib/Sietima/Subscriber.pm +++ b/lib/Sietima/Subscriber.pm @@ -2,13 +2,13 @@ package Sietima::Subscriber; use Moo; use Sietima::Policy; use Types::Standard qw(ArrayRef HashRef Object); -use Type::Params qw(compile); +use Type::Params -sigs; use Sietima::Types qw(Address AddressFromStr); use Email::Address; use List::AllUtils qw(any); use namespace::clean; -our $VERSION = '1.0.5'; # VERSION +our $VERSION = '1.1.3'; # VERSION # ABSTRACT: a subscriber to a mailing list @@ -41,12 +41,11 @@ has prefs => ( ); -sub match { - # we can't use the sub signature here, because we need the - # coercion - state $check = compile(Object,Address->plus_coercions(AddressFromStr)); - my ($self,$addr) = $check->(@_); - +signature_for match => ( + method => Object, + positional => [ Address->plus_coercions(AddressFromStr) ], +); +sub match($self,$addr) { return any { $addr->address eq $_->address } $self->primary, $self->aliases->@*; } @@ -66,7 +65,7 @@ Sietima::Subscriber - a subscriber to a mailing list =head1 VERSION -version 1.0.5 +version 1.1.3 =head1 DESCRIPTION @@ -127,7 +126,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>. +This software is copyright (c) 2025 by Gianni Ceccarelli <dakkar@thenautilus.net>. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. |