File Coverage

lib/Data/TagDB/WeakBaseObject.pm
Criterion Covered Total %
statement 14 17 82.3
branch 0 2 0.0
condition n/a
subroutine 5 6 83.3
pod n/a
total 19 25 76.0


line stmt bran cond sub pod time code
1             # Copyright (c) 2024-2025 Philipp Schafft
2              
3             # licensed under Artistic License 2.0 (see LICENSE file)
4              
5             # ABSTRACT: Work with Tag databases
6              
7             package Data::TagDB::WeakBaseObject;
8              
9 1     1   565 use v5.10;
  1         5  
10 1     1   7 use strict;
  1         2  
  1         26  
11 1     1   5 use warnings;
  1         2  
  1         67  
12              
13 1     1   7 use Scalar::Util qw(weaken);
  1         3  
  1         76  
14              
15 1     1   95 use Carp;
  1         4  
  1         196  
16              
17             our $VERSION = v0.12;
18              
19              
20             # ---- Private helpers ----
21              
22             sub _new {
23 0     0     my ($pkg, %opts) = @_;
24              
25 0 0         weaken($opts{db}) if defined $opts{db};
26              
27 0           return bless \%opts, $pkg;
28             }
29              
30             1;
31              
32             __END__
33              
34             =pod
35              
36             =encoding UTF-8
37              
38             =head1 NAME
39              
40             Data::TagDB::WeakBaseObject - Work with Tag databases
41              
42             =head1 VERSION
43              
44             version v0.12
45              
46             =head1 SYNOPSIS
47              
48             use Data::TagDB;
49              
50             This is an interal package. See L<Data::TagDB>.
51              
52             =head1 AUTHOR
53              
54             Philipp Schafft <lion@cpan.org>
55              
56             =head1 COPYRIGHT AND LICENSE
57              
58             This software is Copyright (c) 2024-2025 by Philipp Schafft <lion@cpan.org>.
59              
60             This is free software, licensed under:
61              
62             The Artistic License 2.0 (GPL Compatible)
63              
64             =cut