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 = '2016-07-22'; # DATE
4             our $VERSION = '0.35'; # VERSION
5              
6 31     31   455 use 5.010;
  31         63  
7 31     31   103 use strict;
  31         33  
  31         591  
8 31     31   94 use warnings;
  31         30  
  31         747  
9 31     31   89 use Mo qw(build default);
  31         37  
  31         119  
10             extends 'Data::ModeMerge::Mode::Base';
11              
12 698     698 1 1447 sub name { 'KEEP' }
13              
14 5885     5885 1 7421 sub precedence_level { 6 }
15              
16 330     330 1 707 sub default_prefix { '^' }
17              
18 330     330 1 1008 sub default_prefix_re { qr/^\^/ }
19              
20             sub merge_SCALAR_SCALAR {
21 47     47 0 91 my ($self, $key, $l, $r) = @_;
22 47         126 ($key, $l);
23             }
24              
25             sub merge_SCALAR_ARRAY {
26 1     1 0 2 my ($self, $key, $l, $r) = @_;
27 1         2 ($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 6 my ($self, $key, $l, $r) = @_;
42 2         15 $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 10 my ($self, $key, $l, $r) = @_;
62 6         49 $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.35 of Data::ModeMerge::Mode::KEEP (from Perl distribution Data-ModeMerge), released on 2016-07-22.
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) 2016 by 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