File Coverage

lib/Archive/BagIt/Role/Plugin.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 25 26 96.1


line stmt bran cond sub pod time code
1             package Archive::BagIt::Role::Plugin;
2 8     8   3548 use strict;
  8         15  
  8         299  
3 8     8   44 use warnings;
  8         14  
  8         224  
4 8     8   37 use Moo::Role;
  8         13  
  8         46  
5 8     8   2685 use namespace::autoclean;
  8         13  
  8         51  
6             # ABSTRACT: A role that handles plugin loading
7             our $VERSION = '0.094'; # VERSION
8              
9             has plugin_name => (
10             is => 'ro',
11             #isa => 'Str',
12             default => __PACKAGE__,
13             );
14              
15              
16             has bagit => (
17             is => 'ro',
18             #isa => 'Archive::BagIt',
19             required => 1,
20             weak_ref => 1,
21             );
22              
23             sub BUILD {
24 215     215 0 31497 my ($self) = @_;
25 215         730 my $plugin_name = $self->plugin_name;
26 215         977 $self->bagit->plugins( { $plugin_name => $self });
27 215         995 return 1;
28             }
29 8     8   1404 no Moo;
  8         17  
  8         43  
30             1;
31              
32             __END__