| 1 | # $Id$ | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | package Google::Chart::Title; | ||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Google::Chart::Types; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Moose::Util::TypeConstraints; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | coerce 'Google::Chart::Title' | ||||||||||||||||||||||||||||
| 9 | => from 'HashRef' | ||||||||||||||||||||||||||||
| 10 | 0 | ▶ | => via { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 11 | 0 | Google::Chart::Title->new(%$_); | |||||||||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||||||||
| 13 | 1 | ; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | with 'Google::Chart::QueryComponent'; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 1 | has 'text' => ( | |||||||||||||||||||||||||||
| 18 | is => 'rw', | ||||||||||||||||||||||||||||
| 19 | isa => 'Str', | ||||||||||||||||||||||||||||
| 20 | required => 1, | ||||||||||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1 | has 'color' => ( | |||||||||||||||||||||||||||
| 24 | is => 'rw', | ||||||||||||||||||||||||||||
| 25 | isa => 'Google::Chart::Color', | ||||||||||||||||||||||||||||
| 26 | ); | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 1 | has 'fontsize' => ( | |||||||||||||||||||||||||||
| 29 | is => 'rw', | ||||||||||||||||||||||||||||
| 30 | isa => 'Num' | ||||||||||||||||||||||||||||
| 31 | ); | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 1 | ▶ | no Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub as_query { | ||||||||||||||||||||||||||
|
Subroutine
as_query: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||
| 38 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | my $text = $self->text; | |||||||||||||||||||||||||||
| 41 | 0 | $text =~ s/\r?\n/|/gsm; | |||||||||||||||||||||||||||
| 42 | 0 | my %data = ( | |||||||||||||||||||||||||||
| 43 | chtt => $text | ||||||||||||||||||||||||||||
| 44 | ); | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | my $color = $self->color; | |||||||||||||||||||||||||||
| 47 | 0 | my $fontsize = $self->fontsize; | |||||||||||||||||||||||||||
| 48 | 0 | ▶ | if (defined $color || defined $fontsize) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $color or defined $fontsize
MC/DC0%0/2
defined $color or defined $fontsize
defined $color
defined $fontsize
Truth table0%0/3
A or B
A= defined $colorB= defined $fontsize
| |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | $data{chts} = join(',', | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 50 | defined $color ? $color : '', | ||||||||||||||||||||||||||||
| 51 | defined $fontsize ? $fontsize : '' | ||||||||||||||||||||||||||||
| 52 | ); | ||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | return wantarray ? %data : | ||||||||||||||||||||||||||||
| 56 | 0 | ▶ | join('&', map { "$_=$data{$_}" } keys %data ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 1 | 1; | |||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | __END__ | ||||||||||||||||||||||||||||