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

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