File Coverage

blib/lib/Params/Dry/Types/Ref.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition n/a
subroutine 14 14 100.0
pod 10 10 100.0
total 46 46 100.0


line stmt bran cond sub pod time code
1             #!/usr/bin/env perl
2             #*
3             #* Info: Ref types definitions module
4             #* Author: Pawel Guspiel (neo77)
5             #*
6             #* This module keeps validation functions. You can of course add your modules which uses this and will add additional checks
7             #* Build in types for Params::Dry
8             #*
9             package Params::Dry::Types::Ref;
10             {
11 3     3   1364 use strict;
  3         5  
  3         98  
12 3     3   16 use warnings;
  3         6  
  3         68  
13 3     3   16 use utf8;
  3         6  
  3         16  
14              
15             # --- version ---
16             our $VERSION = 1.20_03;
17              
18             #=------------------------------------------------------------------------ { use, constants }
19              
20 3     3   155 use Params::Dry::Types qw(:const);
  3         6  
  3         1324  
21              
22             #=------------------------------------------------------------------------ { module public functions }
23              
24             #=---------
25             # Scalar
26             #=---------
27             #* scalar type check
28             #* RETURN: PASS if test pass otherwise FAIL
29             sub Scalar {
30 2     2 1 994 Params::Dry::Types::Ref( $_[0], 'SCALAR' );
31             } #+ end of: sub Scalar
32              
33             #=--------
34             # Array
35             #=--------
36             #* array type check
37             #* RETURN: PASS if test pass otherwise FAIL
38             sub Array {
39 7     7 1 966 Params::Dry::Types::Ref( $_[0], 'ARRAY' );
40             } #+ end of: sub Array
41              
42             #=-------
43             # Hash
44             #=-------
45             #* hash type check
46             #* RETURN: PASS if test pass otherwise FAIL
47             sub Hash {
48 2     2 1 892 Params::Dry::Types::Ref( $_[0], 'HASH' );
49             } #+ end of: sub Hash
50              
51             #=-------
52             # Code
53             #=-------
54             #* code type check
55             #* RETURN: PASS if test pass otherwise FAIL
56             sub Code {
57 2     2 1 884 Params::Dry::Types::Ref( $_[0], 'CODE' );
58             } #+ end of: sub Code
59              
60             #=-------
61             # Glob
62             #=-------
63             #* glob type check
64             #* RETURN: PASS if test pass otherwise FAIL
65             sub Glob {
66 1     1 1 447 Params::Dry::Types::Ref( $_[0], 'GLOB' );
67             } #+ end of: sub Glob
68              
69             #=-------
70             # Ref
71             #=-------
72             #* Ref to Ref type check
73             #* RETURN: PASS if test pass otherwise FAIL
74             sub Ref {
75 1     1 1 395 Params::Dry::Types::Ref( $_[0], 'REF' );
76             } #+ end of: sub Ref
77              
78             #=---------
79             # LValue
80             #=---------
81             #* lvalue type check
82             #* RETURN: PASS if test pass otherwise FAIL
83             sub LValue {
84 1     1 1 424 Params::Dry::Types::Ref( $_[0], 'LVALUE' );
85             } #+ end of: sub LValue
86              
87             #=---------
88             # Format
89             #=---------
90             #* format type check
91             #* RETURN: PASS if test pass otherwise FAIL
92             sub Format {
93 1     1 1 463 Params::Dry::Types::Ref( $_[0], 'FORMAT' );
94             } #+ end of: sub Format
95              
96             #=----------
97             # VString
98             #=----------
99             #* glob type check
100             #* RETURN: PASS if test pass otherwise FAIL
101             sub VString {
102 1     1 1 480 Params::Dry::Types::Ref( $_[0], 'VSTRING' );
103             } #+ end of: sub VString
104              
105             #=---------
106             # Regexp
107             #=---------
108             #* glob type check
109             #* RETURN: PASS if test pass otherwise FAIL
110             sub Regexp {
111 2     2 1 1065 Params::Dry::Types::Ref( $_[0], 'Regexp' );
112             } #+ end of: sub Regexp
113              
114             };
115             0115 && 0x4d;
116              
117             #+ End of Params::Dry::Types::Ref
118             __END__