| 1 | package CXC::Gnuplot::V0::AxisFormat; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use v5.38; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use Feature::Compat::Class; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 4 | our $VERSION = 'v0.29.3'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | class CXC::Gnuplot::V0::AxisFormat; | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 4 | ▶ | no namespace::clean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 4 | ▶ | use Ref::Util qw( is_ref ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 4 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 4 | ▶ | use CXC::Gnuplot::V0::Types -lexical => qw( FormatCoordSys NonEmptyStr); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | use CXC::Gnuplot::V0::Util | ||||||||||||||||||||||||||||
| 18 | 4 | -lexical => 'clone_object', | |||||||||||||||||||||||||||
| 19 | 4 | ▶ | 'assert_coerce_object', 'pvalidate'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | my sub croak { | ||||||||||||||||||||||||||||
| 22 | 0 | ▶ | require Carp; | ||||||||||||||||||||||||||
|
Subroutine
croak: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 23 | 0 | goto \&Carp::croak; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | #<<< notidy | ||||||||||||||||||||||||||||
| 27 | 4 | field $format :param :reader = undef; | |||||||||||||||||||||||||||
| 28 | 4 | field $coord :param :reader = undef; | |||||||||||||||||||||||||||
| 29 | #>>> | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | ADJUST { | ||||||||||||||||||||||||||||
| 44 | 0 | ▶ | pvalidate( coord => FormatCoordSys, \$coord ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 45 | 0 | pvalidate( format => LiteralDataValue => \$format ); | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | method to_hash { | ||||||||||||||||||||||||||||
| 53 | return { | ||||||||||||||||||||||||||||
| 54 | 0 | ▶ | ( defined $coord ? ( coord => $coord ) : () ), # | ||||||||||||||||||||||||||
|
Subroutine
to_hash: not called CC=3 SCAR=24.8
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 55 | ( defined $format ? ( format => $format->value ) : () ), | ||||||||||||||||||||||||||||
| 56 | }; | ||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | ▶ | method clone ( %args ) { | |||||||||||||||||||||||||||
|
Subroutine
clone: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 65 | 0 | clone_object( $self, \%args ); | |||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | ▶ | sub coerce_attrs ( $class, @attrs ) { | |||||||||||||||||||||||||||
|
Subroutine
coerce_attrs: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 74 | 0 | ▶ | return @attrs == 1 && !is_ref( $attrs[0] ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@attrs == 1 and not Ref::Util::XS::is_ref($attrs[0])
MC/DC0%0/2
@attrs == 1 and not Ref::Util::XS::is_ref($attrs[0])
@attrs == 1
not Ref::Util::XS::is_ref($attrs[0])
Truth table0%0/3
A and not(B)
A= @attrs == 1B= not Ref::Util::XS::is_ref($attrs[0])
| |||||||||||||||||||||||||||||
| 75 | ? { format => $attrs[0] } | ||||||||||||||||||||||||||||
| 76 | : undef; | ||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | ▶ | sub assert_coerce( $class, $args ) { | |||||||||||||||||||||||||||
|
Subroutine
assert_coerce: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 84 | 0 | assert_coerce_object( $class, $args ); | |||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | method opts { | ||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | 0 | ▶ | my @opts; | ||||||||||||||||||||||||||
|
Subroutine
opts: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | 0 | ▶ | if ( defined $format ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 97 | 0 | push @opts, $format->stringify; | |||||||||||||||||||||||||||
| 98 | 0 | ▶ | push @opts, $coord if defined $coord; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | 0 | return @opts; | |||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | 4 | 1; | |||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | # | ||||||||||||||||||||||||||||
| 108 | # This file is part of CXC-Gnuplot | ||||||||||||||||||||||||||||
| 109 | # | ||||||||||||||||||||||||||||
| 110 | # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory. | ||||||||||||||||||||||||||||
| 111 | # | ||||||||||||||||||||||||||||
| 112 | # This is free software, licensed under: | ||||||||||||||||||||||||||||
| 113 | # | ||||||||||||||||||||||||||||
| 114 | # The GNU General Public License, Version 3, June 2007 | ||||||||||||||||||||||||||||
| 115 | # | ||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | __END__ | ||||||||||||||||||||||||||||