File Coverage

blib/lib/Sietima/Role/WithMailStore.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package Sietima::Role::WithMailStore;
2 3     3   1783 use Moo::Role;
  3         7  
  3         20  
3 3     3   1009 use Sietima::Policy;
  3         7  
  3         20  
4 3     3   45 use Sietima::Types qw(MailStore MailStoreFromHashRef);
  3         8  
  3         45  
5 3     3   1911 use namespace::clean;
  3         6  
  3         24  
6              
7             our $VERSION = '1.0.4'; # VERSION
8             # ABSTRACT: role for lists with a store for messages
9              
10              
11             has mail_store => (
12             is => 'ro',
13             isa => MailStore,
14             required => 1,
15             coerce => MailStoreFromHashRef,
16             );
17              
18             1;
19              
20             __END__
21              
22             =pod
23              
24             =encoding UTF-8
25              
26             =head1 NAME
27              
28             Sietima::Role::WithMailStore - role for lists with a store for messages
29              
30             =head1 VERSION
31              
32             version 1.0.4
33              
34             =head1 SYNOPSIS
35              
36             my $sietima = Sietima->with_traits('WithMailStore')->new({
37             %args,
38             mail_store => {
39             class => 'Sietima::MailStore::FS',
40             root => '/tmp',
41             },
42             });
43              
44             =head1 DESCRIPTION
45              
46             This role adds a L<< /C<mail_store> >> attribute.
47              
48             On its own, this role is not very useful, but other roles (like L<<
49             C<SubscriberOnly::Moderate>|Sietima::Role::SubscriberOnly::Moderate
50             >>) can have uses for an object that can persistently store messages.
51              
52             =head1 ATTRIBUTES
53              
54             =head2 C<mail_store>
55              
56             Required instance of an object that consumes the L<<
57             C<Sietima::MailStore> >> role. Instead of passing an instance, you can
58             pass a hashref (like in the L</synopsis>): the C<class> key provides
59             the class name, and the rest of the hash will be passed to its
60             constructor.
61              
62             =head1 AUTHOR
63              
64             Gianni Ceccarelli <dakkar@thenautilus.net>
65              
66             =head1 COPYRIGHT AND LICENSE
67              
68             This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
69              
70             This is free software; you can redistribute it and/or modify it under
71             the same terms as the Perl 5 programming language system itself.
72              
73             =cut