Chart/Type/GoogleOMeter.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 33 CC 1 SCAR 6.9
CC
1
Cov
0%
_build_colors
2.0
_build_type
2.0
BEGIN
2.0
CRAP 2.0
1 package Google::Chart::Type::GoogleOMeter;
2 use Moose;
3 use namespace::clean -except => qw(meta);
4  
5 extends 'Google::Chart';
6  
7 with qw(
8 Google::Chart::WithData
9 );
10  
11 has label => (
12 is => 'ro',
13 isa => 'Str',
14 predicate => 'has_label'
15 );
16  
17 has colors => (
18 is => 'ro',
19 isa => 'ArrayRef',
20 lazy_build => 1,
21 );
22  
23 sub _build_colors { [] }
24 sub _build_type { 'gom' }
25  
26 around prepare_query => sub {
27 my ($next, $self, @args) = @_;
28  
29 my @query = $next->($self, @args);
30 if ($self->has_label) {
31 push @query, (chl => $self->label);
32 }
33  
34 my $colors = $self->colors;
35 if (@$colors > 0) {
36 push @query, (chco => join(',', @$colors));
37 }
38 return @query;
39 };
40  
41 __PACKAGE__->meta->make_immutable();
42  
43 1;
44  
45 __END__