File Coverage

blib/lib/WebService/MinFraud/Validator/Base.pm
Criterion Covered Total %
statement 17 19 89.4
branch n/a
condition n/a
subroutine 6 8 75.0
pod n/a
total 23 27 85.1


line stmt bran cond sub pod time code
1             package WebService::MinFraud::Validator::Base;
2              
3 2     2   1007 use Moo;
  2         4  
  2         13  
4 2     2   623 use namespace::autoclean;
  2         4  
  2         10  
5              
6             our $VERSION = '1.010000';
7              
8 2     2   161 use Carp;
  2         5  
  2         124  
9 2     2   13 use Data::Rx;
  2         4  
  2         56  
10 2     2   10 use Types::Standard qw( HashRef InstanceOf Object );
  2         9  
  2         24  
11              
12             has _request_schema_definition => (
13             is => 'lazy',
14             isa => HashRef,
15             builder => '_build_request_schema_definition',
16             );
17              
18             has _rx => (
19             is => 'lazy',
20             isa => InstanceOf ['Data::Rx'],
21             builder => '_build_rx_plugins',
22             );
23              
24             has _schema => (
25             is => 'lazy',
26             isa => Object,
27             builder => sub {
28 57     57   27315 my $self = shift;
29 57         878 $self->_rx->make_schema( $self->_request_schema_definition );
30             },
31             handles => {
32             assert_valid => 'assert_valid',
33             },
34             );
35              
36             sub _build_request_schema_definition {
37 0     0     croak 'Abstract Base Class. This method is implemented in subclasses';
38             }
39              
40             sub _build_rx_plugins {
41 0     0     croak 'Abstract Base Class. This method is implemented in subclasses';
42              
43             }
44              
45             1;
46              
47             # ABSTRACT: Abstract Base Validation for the minFraud requests
48              
49             __END__
50              
51             =pod
52              
53             =encoding UTF-8
54              
55             =head1 NAME
56              
57             WebService::MinFraud::Validator::Base - Abstract Base Validation for the minFraud requests
58              
59             =head1 VERSION
60              
61             version 1.010000
62              
63             =head1 SUPPORT
64              
65             Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>.
66              
67             =head1 AUTHOR
68              
69             Mateu Hunter <mhunter@maxmind.com>
70              
71             =head1 COPYRIGHT AND LICENSE
72              
73             This software is copyright (c) 2015 - 2020 by MaxMind, Inc.
74              
75             This is free software; you can redistribute it and/or modify it under
76             the same terms as the Perl 5 programming language system itself.
77              
78             =cut