blib/lib/PDF/Labels/base.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 3 | 10 | 30.0 |
branch | 0 | 8 | 0.0 |
condition | n/a | ||
subroutine | 1 | 2 | 50.0 |
pod | 0 | 1 | 0.0 |
total | 4 | 21 | 19.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | |||||||
2 | package PDF::Labels::base; | ||||||
3 | 1 | 1 | 5 | use strict; | |||
1 | 2 | ||||||
1 | 177 | ||||||
4 | |||||||
5 | |||||||
6 | sub new { | ||||||
7 | |||||||
8 | 0 | 0 | 0 | 0 | my $class = ref($_[0]) ? ref(shift) : shift; | ||
9 | 0 | 0 | my $opts = ref($_[0]) ? $_[0] : {@_}; | ||||
10 | |||||||
11 | 0 | my $self = bless {}, $class; | |||||
12 | |||||||
13 | 0 | 0 | map { | ||||
14 | 0 | UNIVERSAL::can( $self, $_ ) ? | |||||
15 | $self->$_( $opts->{$_} ) | ||||||
16 | : $self->{$_}=$opts->{$_}; | ||||||
17 | } keys %$opts; | ||||||
18 | |||||||
19 | 0 | 0 | $self->_new if UNIVERSAL::can($self, "_new"); | ||||
20 | |||||||
21 | 0 | return $self; | |||||
22 | |||||||
23 | } | ||||||
24 | |||||||
25 | |||||||
26 | 1; | ||||||
27 |