TableX/Stylable.pm

filter: Statementstmt 65.6% 21 / 32 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 1 totaltotal 57.1% 24 / 42 SCAR 12.5
CC
3
Cov
62%
__ANON__
12.0
__ANON__
1.1
__ANON__
1.1
CRAP 3.5
« TableX/Column.pm ↑ Summary TableX/Types.pm »
1 package PDF::TableX::Stylable;
2  
3 8 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use PDF::TableX::Types qw/StyleDefinition/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # public attributes for styles
7 0 ▶has padding => (is => 'rw', isa => StyleDefinition, coerce => 1, default => sub{[1,1,1,1]} );
Subroutine __ANON__: not called CC=1 SCAR=1.2
8 0 ▶has border_width => (is => 'rw', isa => StyleDefinition, coerce => 1, default => sub{[1,1,1,1]} );
Subroutine __ANON__: not called CC=1 SCAR=1.2
9 8 has border_color => (is => 'rw', isa => StyleDefinition, coerce => 1, default => 'black' );
10 8 has border_style => (is => 'rw', isa => StyleDefinition, coerce => 1, default => 'solid' );
11 8 has background_color => (is => 'rw', isa => 'Str', default => '' );
12 8 has text_align => (is => 'rw', isa => 'Str', default => 'left');
13 8 has font => (is => 'rw', isa => 'Any', default => 'Times');
14 8 has font_color => (is => 'rw', isa => 'Str', default => 'black');
15 8 has font_size => (is => 'rw', isa => 'Num', default => 12);
16 8 has margin => (is => 'rw', isa => StyleDefinition, coerce => 1, default => (10 / 25.4 *72) );
17  
18 0 ▶has _children => (is => 'ro', init_arg => undef, isa => 'ArrayRef[ Object ]', default => sub {[]});
Subroutine __ANON__: not called CC=1 SCAR=1.2
19  
20 8 for my $attr ( __PACKAGE__->attributes ) {
21 around $attr => sub {
22 0 ▶ my ($orig, $self, $value) = @_;
Subroutine __ANON__: not called CC=3 SCAR=24.8
23 0 ▶ if ( defined $value ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 0 0 0
24 0 $self->$orig($value);
25 0 for (@{$self->{_children}}) {
26 0 $_->$attr( $value );
27 }
28 0 return $self;
29 } else {
30 0 return $self->$orig;
31 }
32 80 };
33 }
34  
35 sub attributes {
36 8 ▶ return (grep !/^_/, __PACKAGE__->meta->get_attribute_list);
Subroutine attributes: called CC=1 SCAR=0.0
Pod undocumented
37 }
38  
39 8 1;
« TableX/Column.pm ↑ Summary TableX/Types.pm »