Transfigure/Default.pm

filter: Statementstmt 75.0% 6 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 81.8% 9 / 11 CC 1 SCAR 0.9
CC
1
Cov
75%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Transfigure.pm ↑ Summary Transfigure/Predicate.pm »
1 package Data::Transfigure::Default 1.03;
2 1 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: a transfigurator class that matches anything at very low priority
6  
7 =encoding UTF-8
8
9 =head1 NAME
10
11 Data::Transfigure::Default - a transfigurator class that matches anything at very low
12 priority
13  
14 =head1 DESCRIPTION
15  
16 C<Data::Transfigure::Default> provides the facility for transfiguring values that
17 no other registered transfigurator applies to
18  
19 =cut
20  
21 0 ▶use Object::Pad;
Subroutine BEGIN: called CC=1 SCAR=2.6
22  
23 class Data::Transfigure::Default : does(Data::Transfigure::Node) {
24 use Data::Transfigure::Constants;
25  
26 =head1 METHODS
27  
28 =head2 applies_to( %params )
29  
30 Always returns C<$MATCH_DEFAULT> regardless of parameters
31  
32 =cut
33  
34 method applies_to (%params) {
35 return $NO_MATCH if (ref($params{value}) eq 'HASH' || ref($params{value}) eq 'ARRAY');
36 return $MATCH_DEFAULT;
37 }
38  
39 }
40  
41 =pod
42  
43 =head1 AUTHOR
44  
45 Mark Tyrrell C<< <mark@tyrrminal.dev> >>
46  
47 =head1 LICENSE
48  
49 Copyright (c) 2024 Mark Tyrrell
50  
51 Permission is hereby granted, free of charge, to any person obtaining a copy
52 of this software and associated documentation files (the "Software"), to deal
53 in the Software without restriction, including without limitation the rights
54 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55 copies of the Software, and to permit persons to whom the Software is
56 furnished to do so, subject to the following conditions:
57  
58 The above copyright notice and this permission notice shall be included in all
59 copies or substantial portions of the Software.
60  
61 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
67 SOFTWARE.
68  
69 =cut
70  
71 1;
72  
73 __END__
« Transfigure.pm ↑ Summary Transfigure/Predicate.pm »