Chart/Plotly/Trace/Indicator/Number.pm untested

filter: Statementstmt 0.0% 0 / 37 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 66 CC 5 SCAR 28.7
CC
5
Cov
0%
TO_JSON
30.0
BEGIN
2.0
BEGIN
2.0
CRAP 17.6
1 package Chart::Plotly::Trace::Indicator::Number;
2 use Moose;
3 use MooseX::ExtraArgs;
4 use Moose::Util::TypeConstraints qw(enum union);
5 if ( !defined Moose::Util::TypeConstraints::find_type_constraint('PDL') ) {
6 Moose::Util::TypeConstraints::type('PDL');
7 }
8  
9 use Chart::Plotly::Trace::Indicator::Number::Font;
10  
11 our $VERSION = '0.042'; # VERSION
12  
13 # ABSTRACT: This attribute is one of the possible options for the trace indicator.
14  
15 sub TO_JSON {
16 my $self = shift;
17 my $extra_args = $self->extra_args // {};
18 my $meta = $self->meta;
19 my %hash = %$self;
20 for my $name ( sort keys %hash ) {
21 my $attr = $meta->get_attribute($name);
22 if ( defined $attr ) {
23 my $value = $hash{$name};
24 my $type = $attr->type_constraint;
25 if ( $type && $type->equals('Bool') ) {
26 $hash{$name} = $value ? \1 : \0;
27 }
28 }
29 }
30 %hash = ( %hash, %$extra_args );
31 delete $hash{'extra_args'};
32 if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
33 $hash{type} = $self->type();
34 }
35 return \%hash;
36 }
37  
38 has font => ( is => "rw",
39 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Indicator::Number::Font", );
40  
41 has prefix => ( is => "rw",
42 isa => "Str",
43 documentation => "Sets a prefix appearing before the number.",
44 );
45  
46 has suffix => ( is => "rw",
47 isa => "Str",
48 documentation => "Sets a suffix appearing next to the number.",
49 );
50  
51 has valueformat => (
52 is => "rw",
53 isa => "Str",
54 documentation =>
55 "Sets the value formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format.",
56 );
57  
58 __PACKAGE__->meta->make_immutable();
59 1;
60  
61 __END__