package App::EzPz::EzmlmConfig;

use IO::All;
use Module::Runtime qw(use_module);
use Moo;

has bindir => (
  is => 'ro', required => 1,
);

has list_base_dir => (
  is => 'ro', required => 1,
);

sub new_list_object {
  my ($self, $args) = @_;
  my $list_dir = io->dir($self->list_base_dir)->catdir($args->{list_name});
  use_module('Email::EzPz::List')->new(
    list_dir => $list_dir,
    ezmlm_bindir => $self->bindir,
  );
}

1;
