File Coverage

blib/lib/WebService/ValidSign/Types.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             package WebService::ValidSign::Types;
2             our $VERSION = '0.003';
3 6     6   50 use warnings;
  6         16  
  6         210  
4 6     6   32 use strict;
  6         13  
  6         148  
5              
6             # ABSTRACT: Moo(se) like types defined for WebService::ValidSign
7              
8 6     6   33 use Types::Standard qw(Str);
  6         13  
  6         85  
9 6     6   2802 use URI;
  6         14  
  6         159  
10 6     6   2668 use Type::Utils -all;
  6         29304  
  6         60  
11             use Type::Library
12 6         28 -base,
13             -declare => qw(
14             WebServiceValidSignURI
15             WebServiceValidSignAuthModule
16 6     6   19723 );
  6         17  
17              
18             class_type WebServiceValidSignURI, {class => 'URI' };
19             coerce WebServiceValidSignURI, from Str, via { return URI->new($_); };
20              
21             class_type WebServiceValidSignAuthModule, {class => 'WebService::ValidSign::API::Auth' };
22              
23             1;
24              
25             __END__
26              
27             =pod
28              
29             =encoding UTF-8
30              
31             =head1 NAME
32              
33             WebService::ValidSign::Types - Moo(se) like types defined for WebService::ValidSign
34              
35             =head1 VERSION
36              
37             version 0.003
38              
39             =head1 SYNOPSIS
40              
41             package Foo;
42             use Moo;
43              
44             use WebService::ValidSign::Types qw(WebServiceValidSignURI);
45              
46             has bar => (
47             is => 'ro',
48             isa => WebServiceValidSignURI,
49             );
50              
51             =head1 DESCRIPTION
52              
53             Defines custom types for WebService::ValidSign modules
54              
55             =head1 TYPES
56              
57             =head2 WebServiceValidSignURI
58              
59             Allows a scalar URI, eq 'https://foo.bar.nl', or a URI object.
60              
61             =head1 AUTHOR
62              
63             Wesley Schwengle <waterkip@cpan.org>
64              
65             =head1 COPYRIGHT AND LICENSE
66              
67             This software is Copyright (c) 2019 by Wesley Schwengle.
68              
69             This is free software, licensed under:
70              
71             The (three-clause) BSD License
72              
73             =cut