File Coverage

blib/lib/EPublisher/Target/Base.pm
Criterion Covered Total %
statement 19 19 100.0
branch 3 4 75.0
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 30 31 96.7


line stmt bran cond sub pod time code
1             package EPublisher::Target::Base;
2              
3             # ABSTRACT: Base class for Target plugins
4              
5 5     5   35 use strict;
  5         11  
  5         145  
6 5     5   25 use warnings;
  5         10  
  5         142  
7 5     5   23 use Carp;
  5         9  
  5         1049  
8              
9             our $VERSION = 0.0101;
10              
11             sub new{
12 5     5 1 88 my ($class,$args) = @_;
13            
14 5         18 my $self = bless {}, $class;
15 5         31 $self->_config( $args );
16            
17 5         15 return $self;
18             }
19              
20             sub publisher {
21 3     3 1 11 my ($self,$object) = @_;
22            
23 3 50       11 return $self->{__publisher} if @_ != 2;
24            
25 3         10 $self->{__publisher} = $object;
26             }
27              
28             sub _config{
29 27     27   44 my ($self,$args) = @_;
30            
31 27 100       77 $self->{__config} = $args if defined $args;
32 27         87 return $self->{__config};
33             }
34              
35             1;
36              
37             __END__