A clone of 'official' Archive::BagIt reposity by CPAN author Rob Schmidt (https://github.com/rjeschmi/Archive-BagIt). This repository contains patches to update Archive::BagIt to version 1.0 of BagIt, see RFC 8493 (https://tools.ietf.org/html/rfc8493)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
489 B

package Archive::BagIt::Role::Plugin;
# ABSTRACT: A role that handles plugin loading
use strict;
use warnings;
use Moo::Role;
use namespace::autoclean;
has plugin_name => (
is => 'ro',
#isa => 'Str',
default => __PACKAGE__,
);
has bagit => (
is => 'ro',
#isa => 'Archive::BagIt',
required => 1,
weak_ref => 1,
);
sub BUILD {
my ($self) = @_;
my $plugin_name = $self->plugin_name;
$self->bagit->plugins( { $plugin_name => $self });
return 1;
}
no Moo;
1;