Chart/GGPlot/Scale/DiscreteIdentity.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Chart::GGPlot::Scale::DiscreteIdentity;
2  
3 # ABSTRACT: Discrete identity scale
4  
5 use Chart::GGPlot::Class qw(:pdl);
6 use namespace::autoclean;
7  
8 our $VERSION = '0.002003'; # VERSION
9  
10 use Chart::GGPlot::Util qw(:all);
11  
12 extends qw(
13 Chart::GGPlot::Scale::Discrete
14 );
15  
16 method map_to_limits ( $p, $limits = $self->get_limits ) {
17 if ($p->$_DOES('PDL::Factor')) {
18 return $p->as_pdlsv;
19 } else {
20 return $p;
21 }
22 }
23  
24 method train ($p) {
25 return if $self->guide eq 'none';
26 $self->SUPER::train($p);
27 }
28  
29 __PACKAGE__->meta->make_immutable;
30  
31 1;
32  
33 __END__