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   36 use strict;
  5         13  
  5         150  
6 5     5   26 use warnings;
  5         11  
  5         125  
7 5     5   25 use Carp;
  5         10  
  5         1000  
8              
9             our $VERSION = 0.0101;
10              
11             sub new{
12 5     5 1 103 my ($class,$args) = @_;
13            
14 5         15 my $self = bless {}, $class;
15 5         30 $self->_config( $args );
16            
17 5         16 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         7 $self->{__publisher} = $object;
26             }
27              
28             sub _config{
29 27     27   48 my ($self,$args) = @_;
30            
31 27 100       71 $self->{__config} = $args if defined $args;
32 27         91 return $self->{__config};
33             }
34              
35             1;
36              
37             __END__