Chart/Title.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 35 CC 4 SCAR 26.4
CC
4
Cov
0%
as_query
20.0
BEGIN
2.0
BEGIN
2.0
CRAP 14.0
1  
2 package Google::Chart::Title;
3 use Moose;
4 use namespace::clean -except => qw(meta);
5  
6 has 'text' => (
7 is => 'rw',
8 isa => 'Str',
9 required => 1,
10 );
11  
12 has 'color' => (
13 is => 'rw',
14 isa => 'Google::Chart::Color',
15 );
16  
17 has 'fontsize' => (
18 is => 'rw',
19 isa => 'Num'
20 );
21  
22 sub as_query {
23 my $self = shift;
24  
25 my $text = $self->text;
26 $text =~ s/\r?\n/|/gsm;
27 my %data = (
28 chtt => $text
29 );
30  
31 my $color = $self->color;
32 my $fontsize = $self->fontsize;
33 if (defined $color || defined $fontsize) {
34 $data{chts} = join(',',
35 defined $color ? $color : '',
36 defined $fontsize ? $fontsize : ''
37 );
38 }
39  
40 return %data;
41 }
42  
43 __PACKAGE__->meta->make_immutable;
44  
45 1;
46  
47 __END__