File Coverage

blib/lib/EPublisher/Source/Base.pm
Criterion Covered Total %
statement 20 20 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 32 32 100.0


line stmt bran cond sub pod time code
1             package EPublisher::Source::Base;
2              
3             # ABSTRACT: Base class for Source plugins
4              
5 13     13   87 use strict;
  13         24  
  13         382  
6 13     13   94 use warnings;
  13         25  
  13         327  
7 13     13   76 use Carp;
  13         23  
  13         3009  
8              
9             our $VERSION = 0.03;
10              
11             sub new{
12 37     37 1 18421 my ($class,$args,%params) = @_;
13            
14 37         97 my $self = bless {}, $class;
15 37         165 $self->_config( $args );
16 37         157 $self->publisher( $params{publisher} );
17            
18 37         123 return $self;
19             }
20              
21             sub _config{
22 167     167   373 my ($self,$args) = @_;
23            
24 167 100       494 $self->{__config} = $args if defined $args;
25 167         499 return $self->{__config};
26             }
27              
28             sub publisher {
29 50     50 1 140 my ($self,$object) = @_;
30            
31 50 100       173 return $self->{__publisher} if @_ != 2;
32            
33 41         120 $self->{__publisher} = $object;
34             }
35              
36             1;
37              
38             __END__