File Coverage

blib/lib/WebService/MinFraud/Data/Rx/Type/Hex32.pm
Criterion Covered Total %
statement 21 21 100.0
branch 2 2 100.0
condition 2 3 66.6
subroutine 8 8 100.0
pod 0 2 0.0
total 33 36 91.6


line stmt bran cond sub pod time code
1             package WebService::MinFraud::Data::Rx::Type::Hex32;
2              
3 2     2   50 use 5.010;
  2         9  
4              
5 2     2   12 use strict;
  2         5  
  2         49  
6 2     2   10 use warnings;
  2         9  
  2         55  
7 2     2   11 use namespace::autoclean;
  2         13  
  2         15  
8              
9             our $VERSION = '1.010000';
10              
11 2     2   186 use parent 'Data::Rx::CommonType::EasyNew';
  2         5  
  2         16  
12              
13 2     2   114 use Role::Tiny::With;
  2         5  
  2         377  
14              
15             with 'WebService::MinFraud::Role::Data::Rx::Type';
16              
17             sub assert_valid {
18 2     2 0 366 my ( $self, $value ) = @_;
19              
20 2 100 66     20 return 1 if $value && ( $value =~ m/^[0-9A-Fa-f]{32}$/ );
21              
22 1         13 $self->fail(
23             {
24             error => [qw(type)],
25             message => 'Found value is not a 32 digit hexadecimal number.',
26             value => $value,
27             }
28             );
29             }
30              
31             sub type_uri {
32             ## no critic(ValuesAndExpressions::ProhibitCommaSeparatedStatements)
33 42     42 0 1019 'tag:maxmind.com,MAXMIND:rx/hex32';
34             }
35              
36             1;
37              
38             # ABSTRACT: A type to check for a 32 digit hexadecimal
39              
40             __END__
41              
42             =pod
43              
44             =encoding UTF-8
45              
46             =head1 NAME
47              
48             WebService::MinFraud::Data::Rx::Type::Hex32 - A type to check for a 32 digit hexadecimal
49              
50             =head1 VERSION
51              
52             version 1.010000
53              
54             =head1 SUPPORT
55              
56             Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>.
57              
58             =head1 AUTHOR
59              
60             Mateu Hunter <mhunter@maxmind.com>
61              
62             =head1 COPYRIGHT AND LICENSE
63              
64             This software is copyright (c) 2015 - 2020 by MaxMind, Inc.
65              
66             This is free software; you can redistribute it and/or modify it under
67             the same terms as the Perl 5 programming language system itself.
68              
69             =cut