| 1 | # ABSTRACT: Type library for OpenSky::API | ||
| 2 | |||
| 3 | package OpenSky::API::Types; | ||
| 4 | our $VERSION = '0.002'; | ||
| 5 | use Type::Library | ||
| 6 | -base, | ||
| 7 | -declare => qw( | ||
| 8 | Longitude | ||
| 9 | Latitude | ||
| 10 | ); | ||
| 11 | |||
| 12 | use Type::Utils -all; | ||
| 13 | |||
| 14 | BEGIN { | ||
| 15 | extends qw( | ||
| 16 | Types::Standard | ||
| 17 | Types::Common::Numeric | ||
| 18 | Types::Common::String | ||
| 19 | ); | ||
| 20 | } | ||
| 21 | |||
| 22 | declare Longitude, as Num, where { $_ >= -180 and $lon <= 180 }; | ||
| 23 | declare Latitude, as Num, where { $_ >= -90 and $lon <= 90 }; | ||
| 24 | |||
| 25 | __END__ | ||
| 26 | |||
| 27 | =pod | ||
| 28 | |||
| 29 | =encoding UTF-8 | ||
| 30 | |||
| 31 | =head1 NAME | ||
| 32 | |||
| 33 | OpenSky::API::Types - Type library for OpenSky::API | ||
| 34 | |||
| 35 | =head1 VERSION | ||
| 36 | |||
| 37 | version 0.002 | ||
| 38 | |||
| 39 | =head1 DESCRIPTION | ||
| 40 | |||
| 41 | No user-serviceable parts inside. | ||
| 42 | |||
| 43 | =head1 CUSTOM TYPES | ||
| 44 | |||
| 45 | =head2 Longitude | ||
| 46 | |||
| 47 | A number between -180 and 180, inclusive. | ||
| 48 | |||
| 49 | =head2 Latitude | ||
| 50 | |||
| 51 | A number between -90 and 90, inclusive. | ||
| 52 | |||
| 53 | =head1 AUTHOR | ||
| 54 | |||
| 55 | Curtis "Ovid" Poe <curtis.poe@gmail.com> | ||
| 56 | |||
| 57 | =head1 COPYRIGHT AND LICENSE | ||
| 58 | |||
| 59 | This software is Copyright (c) 2023 by Curtis "Ovid" Poe. | ||
| 60 | |||
| 61 | This is free software, licensed under: | ||
| 62 | |||
| 63 | The Artistic License 2.0 (GPL Compatible) | ||
| 64 | |||
| 65 | =cut |