File Coverage

blib/lib/Mail/Box/Tie.pm
Criterion Covered Total %
statement 16 17 94.1
branch 1 2 50.0
condition 1 3 33.3
subroutine 6 7 85.7
pod 3 3 100.0
total 27 32 84.3


line stmt bran cond sub pod time code
1             # This code is part of Perl distribution Mail-Box version 4.01.
2             # The POD got stripped from this file by OODoc version 3.05.
3             # For contributors see file ChangeLog.
4              
5             # This software is copyright (c) 2001-2025 by Mark Overmeer.
6              
7             # This is free software; you can redistribute it and/or modify it under
8             # the same terms as the Perl 5 programming language system itself.
9             # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10              
11              
12             package Mail::Box::Tie;{
13             our $VERSION = '4.01';
14             }
15              
16              
17 3     3   1596 use strict;
  3         6  
  3         134  
18 3     3   15 use warnings;
  3         5  
  3         219  
19              
20 3     3   17 use Log::Report 'mail-box', import => [ qw/__x error/ ];
  3         6  
  3         43  
21              
22 3     3   584 use Scalar::Util qw/blessed/;
  3         7  
  3         721  
23              
24             #--------------------
25              
26             sub new($$)
27 2     2 1 8 { my ($class, $folder, $type) = @_;
28              
29 2 50 33     59 blessed $folder && $folder->isa('Mail::Box')
30             or error __x"no folder specified to tie to.";
31              
32 2         17 bless +{ MBT_folder => $folder, MBT_type => $type }, $class;
33             }
34              
35             #--------------------
36              
37 153     153 1 580 sub folder() { $_[0]->{MBT_folder} }
38 0     0 1   sub type() { $_[0]->{MBT_type} }
39              
40             1;