File Coverage

blib/lib/CXC/Astro/Regions/CIAO/Types.pm
Criterion Covered Total %
statement 23 23 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 31 31 100.0


line stmt bran cond sub pod time code
1             package CXC::Astro::Regions::CIAO::Types;
2              
3             # ABSTRACT: Types for CIAO Regions
4              
5 5     5   700399 use v5.20;
  5         20  
6 5     5   22 use warnings;
  5         10  
  5         380  
7              
8             our $VERSION = '0.03';
9              
10 5     5   3013 use Types::Standard qw( Enum Bool Num Str StrMatch );
  5         543634  
  5         59  
11 5     5   19454 use Types::Common::Numeric qw( PositiveNum );
  5         140202  
  5         275  
12              
13 5     5   7662 use Type::Utils -all;
  5         36358  
  5         61  
14 5     5   18293 use Regexp::Common qw( number );
  5         16617  
  5         25  
15             use Type::Library
16 5         58 -base,
17             -extends => [ 'Types::Common::Numeric', 'Types::Common::String', 'Types::Standard' ],
18             -declare => qw(
19             Angle
20             Length
21             PositionAsNum
22             Vertex
23             XPosition
24             YPosition
25 5     5   19483 );
  5         13  
26              
27 5     5   471145 use CXC::Types::Astro::Coords 'Sexagesimal';
  5         1742453  
  5         64  
28              
29             declare PositionAsNum,
30             as StrMatch [qr{\A (?: $RE{num}{real} [d]?) \z}x];
31              
32              
33             declare XPosition, as PositionAsNum | Sexagesimal [ -ra, -sep ];
34             declare YPosition, as PositionAsNum | Sexagesimal [ -dec, -sep ];
35             declare Vertex, as Tuple [ XPosition, YPosition ];
36              
37             declare Length, as StrMatch [qr/\A$RE{num}{real} (["d]|[']{1,2})?\z/x];
38              
39             declare Angle, as Num;
40              
41             1;
42              
43             #
44             # This file is part of CXC-Astro-Regions
45             #
46             # This software is Copyright (c) 2023 by Smithsonian Astrophysical Observatory.
47             #
48             # This is free software, licensed under:
49             #
50             # The GNU General Public License, Version 3, June 2007
51             #
52              
53             __END__