blib/lib/CXC/Gnuplot/V1/Range.pm

filter: Statementstmt 75.0% 6 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 81.8% 9 / 11 CC 1 SCAR 0.9
CC
1
Cov
75%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/CXC/Gnuplot/V1/MultiPlot/Title.pm ↑ Summary blib/lib/CXC/Gnuplot/V1/Role/Clone.pm »
1 package CXC::Gnuplot::V1::Range;
2  
3 1 ▶use v5.38;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use experimental 'builtin';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Object::Pad 0.821;
Subroutine BEGIN: called CC=1 SCAR=2.6
6  
7 our $VERSION = 'v0.29.3';
8  
9 class CXC::Gnuplot::V1::Range : isa(CXC::Gnuplot::V1::Base) does( CXC::Gnuplot::V1::Role::Clone );
10  
11 use builtin 'true';
12 use CXC::Gnuplot::V1::Bound;
13  
14 use CXC::Gnuplot::V1::Util
15 -lexical => 'pvalidate',
16 'render_opts';
17  
18 use overload q{""} => \&stringify, fallback => true, bool => sub { 1 };
19  
20 #<<< no tidy
21 field $min :param :reader = undef;
22 field $max :param :reader = undef;
23 field $string;
24 #>>>
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38 my sub croak {
39 require Carp;
40 goto \&Carp::croak;
41 }
42  
43 ADJUST {
44 pvalidate( min => Bound => \$min );
45 pvalidate( max => Bound => \$max );
46 }
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67 method to_hash {
68 return {
69 ( defined $max ? ( max => $max ) : () ), #
70 ( defined $min ? ( min => $min ) : () ),
71 };
72 }
73  
74  
75  
76  
77  
78  
79  
80  
81  
82 method stringify {
83 ( defined( $min // $max ) ? sprintf( '[%s:%s]', $min // q{}, $max // q{} ) : () );
84 }
85  
86  
87  
88  
89  
90 method opts {
91 return $self->stringify();
92 }
93  
94 1;
95  
96 #
97 # This file is part of CXC-Gnuplot
98 #
99 # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory.
100 #
101 # This is free software, licensed under:
102 #
103 # The GNU General Public License, Version 3, June 2007
104 #
105  
106 __END__
« blib/lib/CXC/Gnuplot/V1/MultiPlot/Title.pm ↑ Summary blib/lib/CXC/Gnuplot/V1/Role/Clone.pm »