todo list
[scpubgit/App-EzPz.git] / lib / Email / EzPz / List.pm
CommitLineData
c5f4b6d4 1package Email::EzPz::List;
2
3use Module::Runtime qw(use_module);
4use Moo;
5
6with 'Email::EzPz::ListCore';
7
e191c67d 8has name => (is => 'lazy');
9
10sub _build_name { (shift->list_dir =~ m{/([^/]+)$})[0] }
11
c5f4b6d4 12sub sublist_type { () }
13
14foreach my $type (qw(allow deny mod digest)) {
15 has $type => (
16 is => 'ro',
17 lazy => 1,
18 default => sub { shift->_build_sublist($type) }
19 );
20}
21
22sub _build_sublist {
23 my ($self, $type) = @_;
24 return use_module('Email::EzPz::SubList')->new(
25 (map +($_ => $self->$_), qw(list_dir ezmlm_bindir)),
e191c67d 26 sublist_type => $type,
27 name => $self->name." ${type} list"
c5f4b6d4 28 );
29}
30
311;