aboutsummaryrefslogtreecommitdiff
path: root/lib/Sietima/Role/WithOwner.pm
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2019-04-29 15:44:40 +0100
committerdakkar <dakkar@thenautilus.net>2019-04-29 15:44:40 +0100
commit308c885f76632b56d4841968fe4a8287710be8ce (patch)
tree96df34b4e4959e839415e2c635111d669ccaf1b7 /lib/Sietima/Role/WithOwner.pm
parentv1.0.5 (diff)
parentDzil-build release 1.0.4 (from 402b4b8 on master) (diff)
downloadSietima-308c885f76632b56d4841968fe4a8287710be8ce.tar.gz
Sietima-308c885f76632b56d4841968fe4a8287710be8ce.tar.bz2
Sietima-308c885f76632b56d4841968fe4a8287710be8ce.zip
Dzil-build release 1.0.5 (from ad3b210 on master)v1.0.5
Diffstat (limited to 'lib/Sietima/Role/WithOwner.pm')
-rw-r--r--lib/Sietima/Role/WithOwner.pm67
1 files changed, 48 insertions, 19 deletions
diff --git a/lib/Sietima/Role/WithOwner.pm b/lib/Sietima/Role/WithOwner.pm
index 1dfd362..1793381 100644
--- a/lib/Sietima/Role/WithOwner.pm
+++ b/lib/Sietima/Role/WithOwner.pm
@@ -4,9 +4,41 @@ use Sietima::Policy;
use Sietima::Types qw(Address AddressFromStr);
use namespace::clean;
-# VERSION
+our $VERSION = '1.0.5'; # VERSION
# ABSTRACT: role for lists with an owner
+
+has owner => (
+ is => 'ro',
+ isa => Address,
+ required => 1,
+ coerce => AddressFromStr,
+);
+
+
+around list_addresses => sub($orig,$self) {
+ return +{
+ $self->$orig->%*,
+ owner => $self->owner,
+ };
+};
+
+1;
+
+__END__
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+Sietima::Role::WithOwner - role for lists with an owner
+
+=head1 VERSION
+
+version 1.0.5
+
=head1 SYNOPSIS
my $sietima = Sietima->with_traits('WithOwner')->new({
@@ -23,31 +55,28 @@ On its own, this role is not very useful, but other roles (like L<<
C<SubscriberOnly::Moderate>|Sietima::Role::SubscriberOnly::Moderate
>>) can have uses for an owner address.
-=attr C<owner>
+=head1 ATTRIBUTES
+
+=head2 C<owner>
Required instance of L<< C<Email::Address> >>, coercible from a
string. This is the address of the owner of the list.
-=cut
-
-has owner => (
- is => 'ro',
- isa => Address,
- required => 1,
- coerce => AddressFromStr,
-);
+=head1 MODIFIED METHODS
-=modif C<list_addresses>
+=head2 C<list_addresses>
This method declares the C<owner> address.
-=cut
+=head1 AUTHOR
-around list_addresses => sub($orig,$self) {
- return +{
- $self->$orig->%*,
- owner => $self->owner,
- };
-};
+Gianni Ceccarelli <dakkar@thenautilus.net>
-1;
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2017 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.
+
+=cut