TableX/Stylable.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 100% 42 / 42 CC 3 SCAR 5.1
CC
3
Cov
100%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« TableX/Column.pm ↑ Summary TableX/Drawable.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 27 ▶has padding => (is => 'rw', isa => StyleDefinition, coerce => 1, default => sub{[1,1,1,1]} );
Subroutine __ANON__: called CC=1 SCAR=0.0
8 27 ▶has border_width => (is => 'rw', isa => StyleDefinition, coerce => 1, default => sub{[1,1,1,1]} );
Subroutine __ANON__: called CC=1 SCAR=0.0
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 211 ▶has _children => (is => 'ro', init_arg => undef, isa => 'ArrayRef[ Object ]', default => sub {[]});
Subroutine __ANON__: called CC=1 SCAR=0.0
19  
20 8 for my $attr ( __PACKAGE__->attributes ) {
21 8808 ▶ around $attr => sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
22 8808 my ($orig, $self, $value) = @_;
23 8808 ▶ if ( defined $value ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 774 8034 8808
24 774 $self->$orig($value);
25 774 for (@{$self->{_children}}) {
26 490 $_->$attr( $value );
27 }
28 774 return $self;
29 } else {
30 8034 return $self->$orig;
31 }
32 80 };
33 }
34  
35 189 ▶sub attributes {
Subroutine attributes: called CC=1 SCAR=0.0
Pod documented
36 189 return (grep !/^_/, __PACKAGE__->meta->get_attribute_list);
37 }
38  
39 8 1;
40  
41 =head1 NAME
42  
43 PDF::TableX::Stalable
44  
45 =head1 VERSION
46  
47 TODO
48  
49 =head1 SYNOPSIS
50  
51 TODO
52  
53 =head1 METHODS
54  
55 =head2 attributes
56  
57 TODO
58  
59 =head1 AUTHOR
60  
61 Grzegorz Papkala, C<< <grzegorzpapkala at gmail.com> >>
62  
63 =head1 BUGS
64  
65 Please report any bugs or feature requests at: L<https://github.com/grzegorzpapkala/PDF-TableX/issues>
66  
67 =head1 SUPPORT
68  
69 PDF::TableX is hosted on GitHub L<https://github.com/grzegorzpapkala/PDF-TableX>
70  
71 =head1 ACKNOWLEDGEMENTS
72  
73 =head1 COPYRIGHT & LICENSE
74  
75 Copyright 2013 Grzegorz Papkala, all rights reserved.
76  
77 This program is free software; you can redistribute it and/or modify it
78 under the same terms as Perl itself.
79  
80 =cut
« TableX/Column.pm ↑ Summary TableX/Drawable.pm »