File Coverage

blib/lib/Data/ModeMerge/Mode/KEEP.pm
Criterion Covered Total %
statement 23 33 69.7
branch n/a
condition n/a
subroutine 12 17 70.5
pod 4 13 30.7
total 39 63 61.9


line stmt bran cond sub pod time code
1             package Data::ModeMerge::Mode::KEEP;
2              
3             our $DATE = '2021-08-15'; # DATE
4             our $VERSION = '0.360'; # VERSION
5              
6 31     31   623 use 5.010;
  31         95  
7 31     31   140 use strict;
  31         43  
  31         643  
8 31     31   126 use warnings;
  31         52  
  31         916  
9 31     31   140 use Mo qw(build default);
  31         57  
  31         165  
10             extends 'Data::ModeMerge::Mode::Base';
11              
12 697     697 1 1375 sub name { 'KEEP' }
13              
14 6068     6068 1 9152 sub precedence_level { 6 }
15              
16 330     330 1 847 sub default_prefix { '^' }
17              
18 330     330 1 1058 sub default_prefix_re { qr/^\^/ }
19              
20             sub merge_SCALAR_SCALAR {
21 47     47 0 82 my ($self, $key, $l, $r) = @_;
22 47         133 ($key, $l);
23             }
24              
25             sub merge_SCALAR_ARRAY {
26 1     1 0 4 my ($self, $key, $l, $r) = @_;
27 1         3 ($key, $l);
28             }
29              
30             sub merge_SCALAR_HASH {
31 0     0 0 0 my ($self, $key, $l, $r) = @_;
32 0         0 ($key, $l);
33             }
34              
35             sub merge_ARRAY_SCALAR {
36 0     0 0 0 my ($self, $key, $l, $r) = @_;
37 0         0 ($key, $l);
38             }
39              
40             sub merge_ARRAY_ARRAY {
41 2     2 0 9 my ($self, $key, $l, $r) = @_;
42 2         18 $self->SUPER::merge_ARRAY_ARRAY($key, $l, $r, 'KEEP');
43             };
44              
45             sub merge_ARRAY_HASH {
46 0     0 0 0 my ($self, $key, $l, $r) = @_;
47 0         0 ($key, $l);
48             }
49              
50             sub merge_HASH_SCALAR {
51 0     0 0 0 my ($self, $key, $l, $r) = @_;
52 0         0 ($key, $l);
53             }
54              
55             sub merge_HASH_ARRAY {
56 0     0 0 0 my ($self, $key, $l, $r) = @_;
57 0         0 ($key, $l);
58             }
59              
60             sub merge_HASH_HASH {
61 6     6 0 15 my ($self, $key, $l, $r) = @_;
62 6         89 $self->SUPER::merge_HASH_HASH($key, $l, $r, 'KEEP');
63             };
64              
65             1;
66             # ABSTRACT: Handler for Data::ModeMerge KEEP merge mode
67              
68             __END__
69              
70             =pod
71              
72             =encoding UTF-8
73              
74             =head1 NAME
75              
76             Data::ModeMerge::Mode::KEEP - Handler for Data::ModeMerge KEEP merge mode
77              
78             =head1 VERSION
79              
80             This document describes version 0.360 of Data::ModeMerge::Mode::KEEP (from Perl distribution Data-ModeMerge), released on 2021-08-15.
81              
82             =head1 SYNOPSIS
83              
84             use Data::ModeMerge;
85              
86             =head1 DESCRIPTION
87              
88             This is the class to handle KEEP merge mode.
89              
90             =for Pod::Coverage ^merge_.*
91              
92             =head1 HOMEPAGE
93              
94             Please visit the project's homepage at L<https://metacpan.org/release/Data-ModeMerge>.
95              
96             =head1 SOURCE
97              
98             Source repository is at L<https://github.com/perlancar/perl-Data-ModeMerge>.
99              
100             =head1 BUGS
101              
102             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-ModeMerge>
103              
104             When submitting a bug or request, please include a test-file or a
105             patch to an existing test-file that illustrates the bug or desired
106             feature.
107              
108             =head1 AUTHOR
109              
110             perlancar <perlancar@cpan.org>
111              
112             =head1 COPYRIGHT AND LICENSE
113              
114             This software is copyright (c) 2021, 2016, 2015, 2013, 2012, 2011, 2010 by perlancar <perlancar@cpan.org>.
115              
116             This is free software; you can redistribute it and/or modify it under
117             the same terms as the Perl 5 programming language system itself.
118              
119             =cut